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
Event Sourcing
Storing every change that ever happened, instead of only the current state, so the current state becomes a derived view.
Data & Content13 connections
Upsert
Inserting a row if it doesn't exist and updating it if it does, in one atomic statement, which is harder than it sounds because the obvious check-then-insert version races with itself.
Data & Content13 connections
Materialized View
The stored result of a query, kept as a table so that expensive reads become cheap, at the cost of keeping that result up to date.
Data & Content9 connections
ETL Pipeline
The job of pulling data out of operational systems, cleaning and reshaping it, and loading it somewhere it can be analyzed, and the move from transforming before loading to transforming after.
Data & Content9 connections
Linked from9
- Audit LogData & Content
An append-only record of who did what, to what, and when, kept to answer questions of accountability long after the fact, and built so that even its administrators can't quietly rewrite it.
- DenormalizationData & Content
Deliberately duplicating data to make reads faster, trading update complexity for query simplicity.
- ETL PipelineData & Content
The job of pulling data out of operational systems, cleaning and reshaping it, and loading it somewhere it can be analyzed, and the move from transforming before loading to transforming after.
- Event SourcingData & Content
Storing every change that ever happened, instead of only the current state, so the current state becomes a derived view.
- Materialized ViewData & Content
The stored result of a query, kept as a table so that expensive reads become cheap, at the cost of keeping that result up to date.
- 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.
- Soft DeleteData & Content
Marking a record as deleted instead of removing it, which makes deletion reversible and auditable but leaks complexity into every query.
- Two-Phase CommitData & Content
A protocol for committing one transaction across multiple databases atomically, at the cost of blocking if the coordinator dies.
- UpsertData & Content
Inserting a row if it doesn't exist and updating it if it does, in one atomic statement, which is harder than it sounds because the obvious check-then-insert version races with itself.