Spensara Spensara Knowledge Base & Documentation Repository

Repository Docs & Knowledge Base

Consolidated Spensara documentation repository (722 Markdown & architecture documents in ../repository)
Built Word Documents (.docx): Spensara Overview (.docx) Capability Assessment (.docx) Brink POS Ingestion Analysis (.docx) The Borg Ingestion Architecture (.docx)
etl/docs/features/ETL/kds-cdc/implementation-breakdown.md 6,255 bytes · Updated Oct 23, 2026 10:44 AM EDT
Raw File

KDS CDC Implementation Breakdown

Purpose

Track main implementation tasks for KDS CDC ingestion. This is a planning checklist, not a detailed execution spec.

Task Checklist

  • [ ] 1. Establish KDS CDC adapter identity and pipeline integration

Scope:

  • introduce production source identity for KDS CDC and keep it separate from SyntheticKds
  • register adapter in existing ETL framework with ingestion mode Cdc
  • define stage list and adapter wiring so KDS CDC follows framework-native stage execution

Sources:

  • [ ] 2. Implement SQS FIFO intake, validation, and ordered micro-batching

Scope:

  • poll Debezium CDC messages from cross-account SQS FIFO
  • validate required message metadata and detect malformed, duplicate, missing, or out-of-order records
  • build bounded micro-batches using count, age, and memory/visibility limits instead of one batch per record
  • preserve global ordering guarantees before downstream load begins

Sources:

  • [ ] 3. Prepare mock CDC contract and producer for SQS-based integration

Scope:

  • define mock Debezium-style CDC payload contract used during pre-infrastructure delivery
  • build traffic generation/mock publishing so simulated CDC load enters through SQS rather than bypassing worker entry path
  • keep worker integration pointed at SQS so mock mode exercises same intake, ordering, and acknowledgment behavior as production path
  • keep mocking isolated to producer-side contract generation and do not replace SQS integration with in-memory shortcuts

Sources:

  • [ ] 4. Implement tenant resolution and quarantine boundaries

Scope:

  • map source customer/account to company_id and store_guid to tenant_id
  • block implicit or ambiguous tenant inference
  • quarantine record-local mapping failures with enough metadata for diagnosis and replay
  • ensure unresolved records never reach tenant-scoped S3 paths or Redshift loads

Sources:

  • [ ] 5. Persist raw CDC batches and create durable ingestion job state

Scope:

  • write accepted CDC envelopes to tenant/entity-scoped S3 raw storage
  • preserve replay-safe source metadata in raw artifacts
  • create durable internal batch/job metadata after raw write succeeds
  • acknowledge SQS messages only after raw persistence and durable resume state exist

Sources:

  • [ ] 6. Build normalization and Redshift staging load path

Scope:

  • transform raw CDC envelopes into load-ready Parquet artifacts split by tenant and entity
  • preserve delete flags, dedupe keys, and ordering metadata during normalization
  • load source-shaped staging tables with idempotent Redshift COPY-based behavior
  • fail safely when valid load artifacts or ordered staging application cannot be guaranteed

Sources:

  • [ ] 7. Implement curated transformation and curated-to-S3 export

Scope:

  • apply idempotent staging-to-curated merges for KDS warehouse targets
  • preserve production KDS CDC source identity and soft-delete semantics in curated layer
  • export curated data to tenant/entity-partitioned S3 Parquet with Redshift UNLOAD
  • treat curated export as part of first delivery, not later follow-up work

Sources:

  • [ ] 8. Add checkpointing, replay, failure handling, and lineage support

Scope:

  • implement per-stage batch lifecycle, upstream chaining, and explicit completion/failure behavior
  • persist checkpoints using Debezium/source coordinates and SQS ordering metadata
  • support replay from raw, load, curated, and coordinate-bounded recovery points
  • standardize quarantine and failed-package diagnostics across record-level and batch-level failures

Sources:

  • [ ] 9. Validate operational behavior and delivery readiness

Scope:

  • verify low-volume, high-volume, redelivery, duplicate, and out-of-order scenarios
  • verify idempotent retries across raw, load, curated, and export failure points
  • confirm batch boundaries, checkpoint advancement, and quarantine behavior match spec
  • confirm excluded behavior is not introduced during implementation

Sources: