Change Data Capture
Turning a database's own internal write log into a stream other systems can subscribe to, without touching the application.
Change data capture reads a database's own internal record of writes — usually its write-ahead log — and turns it into a stream of change events that other systems can subscribe to: a row inserted, updated, or deleted, with the before and after values. Tools like Debezium tap Postgres's or MySQL's replication log the same way a replica would, but instead of applying the changes to another database, they publish each one onto a Message Queue like Kafka for anything downstream to consume.
The alternative it replaces is the application itself publishing an event every time it changes something — reliable in principle, but only if every single write path in the codebase remembers to do it, forever, including the migration script someone runs by hand at 2am. CDC instead reads from the log the database was already going to write regardless, so it captures every change with no cooperation required from application code, and nothing can slip through by omission.
This is what makes CDC the practical backbone for keeping a search index, a cache (see Cache Invalidation), or an analytics warehouse in sync with a primary database without dual writes — the well-known failure mode where an application writes to the database, then separately writes to the search index, and a crash between the two leaves them permanently disagreeing. CDC instead derives the second write from the first one's own durable log, so the two can never drift out of guaranteed order, only lag behind by some bounded delay — the same Eventual Consistency tradeoff Database Replication makes for the same underlying reason.
See also4
Write-Ahead Logging
Recording the intent of a change durably before applying it, so a crash can be recovered.
Computation & Algorithms17 connections
Event Sourcing
Storing every change that ever happened, instead of only the current state, so the current state becomes a derived view.
Data & Content5 connections
Message Queue
A buffer that decouples a producer from a consumer in time, so neither has to be up, fast, or reachable at the same moment.
Data & Content7 connections
Eventual Consistency
A guarantee that replicas converge given no further updates, without guaranteeing when.
Networks & Distribution16 connections
Linked from4
- DenormalizationData & Content
Deliberately duplicating data to make reads faster, trading update complexity for query simplicity.
- Event SourcingData & Content
Storing every change that ever happened, instead of only the current state, so the current state becomes a derived view.
- Message QueueData & Content
A buffer that decouples a producer from a consumer in time, so neither has to be up, fast, or reachable at the same moment.
- Two-Phase CommitData & Content
A protocol for committing one transaction across multiple databases atomically, at the cost of blocking if the coordinator dies.