Change data capture
Every guide in this section ends with the same arrow: data copied from the app database into a search index, a warehouse, a cache or another service. Change data capture (CDC) makes that arrow reliable: it reads the database's own log (How a database stores data) and turns every committed change into an event. What you'll be asked is how it starts, how it keeps order, and what happens to the database when the reader stops.
The till roll
Picture a shop whose head office wants to know what changed today. One way: count the shelves every night and compare with yesterday. It's slow, and misses the umbrella sold and returned in the afternoon. The other way: read the till roll. Every sale and refund is printed on it, in order, with a line number. Head office keeps a bookmark, "read up to line 48,113". The shop keeps the roll until it's copied, so if head office stops reading for a week, the roll piles up behind the counter. A new clerk at head office starts with one stocktake, then reads the roll from the line where the stocktake was taken.