← Files SQL CopilotARCHIVED FILE
references/incremental-and-cdc.md
1.16 KB · Nov 27, 2026 · 19:07 UTC
# Incremental processing, CDC and merges Define: target grain, business key, source sequence/version, event time, ingestion time, high-water mark, late-arrival tolerance, tombstone/delete semantics and replay window. Don't confuse `updated_at` with guaranteed CDC ordering if the source doesn't guarantee it. ## Reliable source preparation Normalize types and filter authorized scope. Deduplicate multiple changes per target key deterministically, honoring deletes, versions and source order. Validate source key uniqueness **before** target MERGE where the platform expects one source row per target. Define repeated-run behavior and watermark advancement only after a successful commit/checkpoint. ## Replay/backfill Preview affected date/key range; estimate volume and downstream impacts. Use bounded reprocessing and reconcile inserts/updates/deletes to source events. Preserve checkpoints and idempotent effects; avoid accidental full refresh or cross-tenant data mixing. ## Tests Duplicate event, late event, out-of-order update, delete tombstone, repeated batch, missing key, corrupt payload and partial failure. Reconcile final state and audit events, not just processing counts.
SHA-256: 2d7bde21ae04001e58f760ff40496ab7fee57c24f608b02222346268473d2a2d