What CDC Solves
Other systems often need to react when a database changes, for example to update a search index or a cache. Polling the table is slow and misses fast updates. Change data capture (CDC) emits a stream of every insert, update, and delete as it happens.
How It Works
- The most reliable approach reads the database write ahead log, the same record used for crash recovery.
- Each committed change becomes an event with the old and new row values.
- Events flow into a message queue like Kafka for consumers to process.
Why Log Based CDC Wins
- It captures every change in commit order with no gaps.
- It adds little load because it tails an existing log instead of querying tables.
- Consumers can rebuild downstream state by replaying the stream.
Key idea
Change data capture turns committed database changes into an ordered event stream, usually by reading the write ahead log, so downstream systems stay in sync without polling.