PrepCity

Change data capture

Open the lab

By the last page, this is the design you will have built. Drag it, or Show all, to see every part.

Lesson · 9 pages · about 8 min

Change data capture

Copy every insert, update and delete out of a live database as it happens. Measured on one day of orders: polling never sees deletes, reading the log does, and a stalled log reader can stop the shop.

What it is
Change data capture (CDC) copies every insert, update and delete from a database to somewhere else, such as a warehouse or a search index, as they happen.
What it is for
Reports and search need the shop’s data, but heavy queries on the live database slow the shop down. A copy kept up to date by CDC takes that load away.
Use it when
When another system needs an up-to-date copy of a database’s tables, deleted rows included, within seconds or minutes.
Not when
When a nightly full copy is fresh enough and the table is small: a plain export is simpler and has nothing to stall.

Words you’ll learn

  • Database
  • Row
  • Purge
  • Request
  • Polling
  • Write-ahead log
  • Debezium
  • Replication slot
  • Event
  • Kafka

Page by page