Skip to catalogue

152

change data capture

also CDC

Read the database log of changes instead of polling tables. The log is the stream.

What is change data capture?

CDC tails the write-ahead log and emits inserts, updates, and deletes in order. Downstream builds search indexes, warehouses, and caches. Polling `updated_at` misses deletes and melts the primary.

Why does change data capture matter when vibe coding?

Models `SELECT * WHERE updated_at > ?` on a timer. Clock skew and deletes break it. Name the log.

How do you do change data capture?

Use the database’s log consumer. Include primary key and operation type. Consumers are idempotent. Snapshot plus log, not log alone, for the first load.

How do you ask a model for change data capture?

Capture changes from (table) via CDC on the write-ahead log, not polling. Events include key and op (insert, update, delete). Consumers are idempotent. Initial load is a snapshot, then the log.

What goes wrong with change data capture?

Two consumers sharing one log cursor. One advances it and the other skips. Each consumer keeps its own position.

adjacent