Zero-Loss CDC: a production playbook for MySQL to Debezium to Kafka to ClickHouse
Most CDC tutorials stop when the first event shows up in a topic. This playbook starts there: how to make sure every row change reaches the warehouse, how to prove it did, and what to do on the day it doesn't.
Launch price $39 for the first two weeks, then $49. Email me to get the release link.
Illustration of the method in the book. All examples use a fictional shop schema.
What you will be able to do
Every row change reaches the warehouse, and you can prove it.
- Configure MySQL binlog and Debezium so you capture every insert, update and delete, including during snapshots
- Run a 3-node Kafka cluster in KRaft mode without ZooKeeper
- Write Python consumers that commit offsets only after ClickHouse confirms the write (fail-closed)
- Pick the right ClickHouse table engine for upserts and deletes from CDC
- Reconcile source and warehouse down to the row id, and alert on drift
- Backfill a table or a time window without double counting
- Run a separate webhook consumer group off the same topics without slowing the warehouse
Table of contents
Plus appendices: full config reference, reconciliation SQL and a glossary.
- CHAPTER 01
Why CDC pipelines lose rows (and why nobody notices)
Where rows go missing and why dashboards hide it.
- CHAPTER 02
Reference architecture and the zero-loss contract
The five hops, what each one promises, and the one rule: nothing is acknowledged until the next hop has it.
- CHAPTER 03
MySQL binlog setup that holds up in production
ROW format, full row image, GTIDs, binlog retention vs. worst-case outage, grants, replicas as source.
- CHAPTER 04
Debezium connector configuration, snapshots and schema history
Snapshot modes, incremental snapshots via a signal table, schema history protection, heartbeats, tombstones.
- CHAPTER 05
Kafka in KRaft mode: a 3-node cluster, topics, partitions, retention
Controller quorum, replication factor 3, min.insync.replicas 2, acks=all, retention sized for your longest outage.
- CHAPTER 06
Fail-closed Python consumers: commit only after the warehouse confirms
Auto-commit off, batch, insert, confirm, commit. Idempotent writes, poison messages, rebalances.
- CHAPTER 07
ClickHouse modelling for CDC: ReplacingMergeTree, versions, deletes
Version columns, delete markers, FINAL vs. argMax views, partitioning, async insert trade-offs.
- CHAPTER 08
Id-level audit and reconciliation
Per-table id-range checksums, missing-id detection, hourly and daily jobs, drift alerts.
- CHAPTER 09
Backfills and replays without double counting
Re-snapshot one table, replay a time window from Kafka, version-based dedupe, cutover checklist.
- CHAPTER 10
A second consumer group for webhooks and side effects
Separate group ids and lag budgets, at-least-once side effects with idempotency keys.
- CHAPTER 11
Monitoring, alerting and the on-call runbook
Connector state, consumer lag, binlog position vs. retention, reconciliation drift, and what to do for each.
- CHAPTER 12
Schema changes, upgrades and the go-live checklist
DDL on the source, adding columns, renames, Kafka and Debezium upgrades, and the go-live list.
Who this is for
Data engineers and backend engineers who have to move MySQL data into ClickHouse (or a similar warehouse) in near real time and cannot afford silent gaps. You should be comfortable with SQL, Python and Docker. You do not need to be a Kafka expert.
What you get
PDF and EPUB, 12 chapters, all config and code snippets, and a checklist at the end of every chapter.
Lab tier: a Git repository with the Docker Compose setup (MySQL, Debezium, 3-node KRaft Kafka, ClickHouse) and the reconciliation SQL.
Free updates for every 2027 edition.
Written from production, not from the docs
I'm Danish Rajpoot, a Principal Data Engineer with 8+ years in data platforms. I run a CDC platform replicating 200+ MySQL tables into ClickHouse at peaks above 28,000 rows a minute. The playbook is the method behind it, rewritten from scratch with generic examples. No employer code, configs or internal documents are included.
Playbook pricing
One-time payment. Pick the depth you need.
Playbook
Early access PDF: chapter 1 now, the remaining chapters sent free as they are finished. Config and code snippets, checklists. Launch price $39, secure checkout on Gumroad.
Buy now ($39)Playbook + lab
Adds a Docker Compose lab (MySQL, Debezium, 3-node KRaft Kafka, ClickHouse) and the reconciliation SQL pack.
Get early accessTeam
Up to 10 readers, the lab, and a 45-minute call to review your pipeline design.
Get early accessFree updates for every 2027 edition. 14-day refund if it is not useful to you.
Kafka CDC playbook: questions
Does it cover PostgreSQL or SQL Server?
The examples use MySQL. The consumer, reconciliation and backfill chapters apply to any Debezium source, and the notes call out Postgres differences.
Is this for Kafka Connect sinks or custom consumers?
Custom Python consumers. Chapter 6 explains when the ClickHouse Kafka engine or a Connect sink is good enough and when it is not.
Which versions does it use?
Recent Debezium 2.x/3.x, Kafka 3.x/4.x in KRaft mode, and current ClickHouse. Version-specific settings are marked.
Is any company code included?
No. Every example is written from scratch for the book with fictional tables.
What format do I get?
PDF and EPUB. The lab tier includes a Git repository with the Docker Compose setup and SQL.
Can I get a refund?
Yes, within 14 days, no questions asked.
Stop guessing whether your pipeline dropped rows
Get the method, the checks and the runbook in one place.