QA
Intermediate LevelSystem Design & Architecture

What is Change Data Capture (CDC) and how does Debezium stream database mutations?

❓ Interview Prompt: Explain Change Data Capture (CDC), Debezium connector, tailing database transaction logs (binlog/WAL), and zero-query-overhead event streaming.

Change Data Capture (CDC) streams database row mutations ('INSERT', 'UPDATE', 'DELETE') into event brokers (Kafka) by tailing the database's native transaction log (MySQL binlog / Postgres WAL):

Advantages over DB Polling:

β€’
Zero Application Changes: Captures DB mutations without application code changes.
β€’
Zero Query Overhead: Tails log files on disk without executing heavy 'SELECT' queries on primary database tables.
β€’
Captures Deletes: Reliable event detection for hard deletes.

Code Implementation Example

json
{
  "before": { "id": 10, "status": "PENDING" },
  "after": { "id": 10, "status": "SHIPPED" },
  "op": "u",
  "source": { "db": "orders", "table": "order_records" }
}
πŸ’‘Debezium Change Data Capture (CDC) JSON event payload.
🎯 Interview Key Takeaway

Deploy Change Data Capture (CDC) with Debezium to stream database mutations into Kafka with zero performance impact on database query engines.

#System Design#CDC#Debezium#Kafka#Intermediate
Back to all System Design & Architecture Questions→

More System Design & Architecture Interview Questions

Beginner LevelSystem Design & Architecture

Explain the CAP Theorem and PACELC Theorem with real-world database examples.

Beginner LevelSystem Design & Architecture

What is Vertical Scaling (Scale Up) vs Horizontal Scaling (Scale Out)?

Beginner LevelSystem Design & Architecture

How do Load Balancers distribute traffic (Round Robin, Least Connections, IP Hash)?