Definition
Change data capture is the practice of reading a database's own replication log and publishing each committed row change as an event. Because the log is the same source of truth the database uses for replication, consumers see exactly the changes that committed, in commit order, without polling tables or adding triggers.
Its main value is eliminating dual writes. Writing to the database and then publishing to a message queue in application code is not atomic: a crash between the two leaves the systems permanently disagreeing. CDC makes the database write the only write, and the event stream a derived consequence of it — the same reasoning behind the transactional outbox pattern. It is how search indexes, caches, analytics warehouses, and downstream services are typically kept current.
How it comes up in interviews
Reach for CDC whenever a design needs the same fact in two stores — a database plus a search index, or a cache that must not go stale. Naming the dual-write failure explicitly is the point: interviewers are checking whether you noticed that "write to Postgres, then publish to Kafka" has a window where one succeeds and the other does not.