System design · interactive
Change data capture
Data often lives in more than one place: the database, a search index, a cache, a warehouse. Writing to each from the app (dual writes) drifts apart on any crash. Change data capture reads the database's own log and streams every committed change out.
Postgres
- —
WAL (log)
- (not used)
Kafka
- (not used)
Search index
- —
In sync
Products live in Postgres; search runs on a separate index (Elasticsearch). They must agree.
Approach
Step 1 of 4 · read left to right
In production
Tools and technologies
CDC keeps search, caches and warehouses in sync with the database.
Not tied to one language — use these names when you search docs or design a system.