Lesson 1 · CDC foundations & the source
The pipeline map
How a row change in one service's database becomes an event that reaches other services — and why this repo runs the whole thing three separate times.
Your win: draw the end-to-end pipeline, name its stages, distinguish log-based from query-based CDC, and identify the three CDC stacks so every later lesson has a place to live.
The problem CDC solves
Every service here owns its own Postgres — bob, eureka, auth, payment. But data has to
cross those boundaries: auth needs a copy of bob's users; the
analytics warehouse needs facts from all of them. You could have each service publish events by
hand — but then a write to the DB and a publish to Kafka are two steps that can half-fail (the
dual-write problem, Lesson 11). Change Data Capture avoids that:
it derives the event stream from the database's own committed changes. One source of
truth, no drift.1
Log-based vs query-based CDC
There are two ways to capture changes, and the choice defines everything:
| Query-based (polling) | Log-based (this repo) | |
|---|---|---|
| How | SELECT … WHERE updated_at > last, on a timer | read the database's write-ahead log |
| Deletes | invisible (the row is gone) | captured (the log records them) |
| Missed changes | two updates between polls → you see one | every change, in order |
| Load | repeated scans on the live DB | ~none (reads a log the DB already writes) |
The pipeline, end to end
Every change follows the same shape. Memorize it; it's the skeleton of the whole course:
Four stages: capture (Debezium reads the WAL → change event), transport (a Kafka topic per table), an optional transform (ksqlDB joins/reshapes for the warehouse), and apply (a JDBC sink upserts into the destination). Parts 1–3 walk these left to right.
The one framing to hold: three stacks
Here's the thing that confuses everyone first. "CDC here" is not one pipeline — the same machinery is deployed three times, with three separate Connect clusters, schema registries, and ksqlDB servers:
1 · Cross-service data-sync
The biggest. Debezium captures each service's Postgres; ~237 JDBC sinks replicate specific tables into other services' Postgres (bob→auth, bob→eureka). Operational data federation — no warehouse.
2 · The KEC warehouse
CDC → ksqlDB joins/aggregations → JDBC sink into an analytics warehouse.
3 · lmsdwh
The LMS analytics warehouse — a star schema, fed by chained CDC (services → lmsdwh → partner warehouses).
internal/golibs/debezium/ + generated configs in
local/configs/services/kafka-connect-source-connector/. The sinks:
…/kafka-connect-gen-sink-connector/. The generator: internal/platform/datapipeline/.
The control plane: cmd/server/hephaestus/. The repo map
has every anchor.
What Debezium & CDC are
The clearest intro to log-based change data capture and where it fits — from the project itself, plus the mental model of "the log as the source of truth."
→ debezium.io — tutorial & overview
→ Confluent — Kafka Connect ·
Kleppmann — "turning the database inside out"
Check yourself (from memory)
Q1. What is the core advantage of log-based CDC over polling?
Q2. What are the four stages of the pipeline, in order?
Q3. "The Connect cluster" in this repo refers to…
1. Debezium overview, Kafka Connect. In-repo map: docs/cdc/reference/repo-cdc-map.md.