Skip to content
About
Main content

What change data capture forbids, and what escaping costs

What the area forbids

These are the things no design here can do.

  1. You cannot detect a change the source did not record. No mechanism recovers an untraced mutation, and none can measure its own blind spot.
  2. You cannot preserve cross-row transactional atomicity through key-partitioned transport without giving up the parallelism that made the transport worth having.
  3. You cannot incrementally maintain a non-invertible aggregate in time proportional to the change.
  4. You cannot replay beyond your retention.
  5. You cannot verify that derived state matches source state by any means internal to the incremental path. Only a recomputation proves it.

Principle: derived state drifts, and only a full recomputation can prove it has not

This is not to fix known bugs. It is anti-entropy (a regular process that finds and repairs divergence) against unknown ones. It is the same idea as read repair in replicated databases (checking replicas against each other when you read) and scrubbing in storage (re-reading data to find silent corruption), relocated to the pipeline layer. It is the same answer every time a system cannot verify its own invariant locally.

A practical reconciliation compares cheap summaries, not full data: row counts and a checksum per or key range, on both sides. Only ranges that differ are re-copied.

-- run on source and on warehouse, then compare per day
SELECT date_trunc('day', created_at) AS day,
       count(*)                       AS n,
       sum(total)                     AS revenue,
       sum(hashtext(order_id::text || status || total::text)::bigint) AS checksum
FROM orders GROUP BY 1;

The escapes and their prices

Each limitation above has an escape, and every escape has a price.

EscapeWhat it removesWhat it costs
Full recomputeevery constraint aboveS · c per run. It is the correct answer far more often than the discussion suggests
keyed sinksthe problempath-dependence: you can never build an audit trail on that sink
Retention (keep the log longer)the problem, and limitsmoney proportional to time
Approximation ()the inverse requirementexactness
divergenceavailability and operational sanity
The the borrowed-interface problema write amplification you control

Every one of these is the conserved-cost rule: the cost moved; none of them deleted it.


Retention is a negotiation

A shape appeared three times here without being new:

This is the general rule that every store grows an indirection layer plus a garbage collector, now with a second half: the collector's schedule is set by whoever is furthest behind.