What is database CDC (Change Data Capture)?

Answer

Change Data Capture (CDC) tracks and captures every insert, update, and delete made to database tables, making these change events available to downstream systems in near real-time. Implementation methods: WAL-based CDC (reads the database's write-ahead log directly — minimal overhead, used by Debezium with PostgreSQL and MySQL binlog); trigger-based CDC (triggers write changes to a history table — more intrusive); timestamp-based polling (periodically polls for rows with updated_at > last_run — misses deletes). CDC enables: event sourcing, data synchronization, real-time analytics pipelines (Kafka + Debezium), cache invalidation, and audit logging. Popular tools: Debezium, AWS DMS, Fivetran.