-
-
Notifications
You must be signed in to change notification settings - Fork 1
CDC Capture
github-actions[bot] edited this page Sep 6, 2026
·
1 revision
CDC (Change Data Capture) captures real-time changes from source databases using Debezium, then routes them to destination writers.
Source DB (WAL/binlog)
|
v
Debezium Engine (runs on virtual thread)
|
v
CaptureLifecycle (start/stop/pause/resume)
|
+--> In-memory event queue (per pipeline)
| |
| v
| SyncOrchestrator (drain + transform + write)
| |
| v
| DestinationRouter (batched writes)
|
+--> [Optional] Kafka transport (when syncflow.kafka.enabled=true)
| Method | Path | Description |
|---|---|---|
POST |
/api/pipelines/{id}/capture/start |
Start CDC capture |
POST |
/api/pipelines/{id}/capture/stop |
Stop CDC capture |
POST |
/api/pipelines/{id}/capture/pause |
Pause CDC capture |
POST |
/api/pipelines/{id}/capture/resume |
Resume CDC capture |
GET |
/api/pipelines/{id}/capture/status |
Get capture status + event count |
CDC offsets track the position in the source's WAL/binlog. Stored in debezium_offsets (Postgres BYTEA for durable key/value pairs).
On restart, Debezium resumes from the last committed offset — no data loss, no duplication.
SyncOrchestrator processes CDC events:
-
Drain — Pulls up to
batch-sizeevents from the queue - Group — Groups by table and operation type
- Transform — Applies column mappings and transformations
-
Write — Calls
DestinationRouter.writeBatch()(single flush + commit per table) -
Idempotency —
markProcessedIfAbsentprevents duplicate processing
Events that fail after max-attempts retries go to the DLQ:
- Stored in
dead_letter_eventstable (JPA-backed, survives restarts) - Viewable via dashboard
- Replayable via API
- Each replay increments
replay_count
-
Bounded queue —
syncflow.runtime.sync.queue-capacity(default 10000) -
Circuit breaker —
CircuitBreakerEventPublisherpauses capture when destination is unhealthy - DLQ overflow — Events exceeding retry count are routed to DLQ, not dropped
CDC provides at-least-once delivery. SyncFlow achieves effective exactly-once via:
-
Idempotent writes —
markProcessedIfAbsentinprocessed_eventstable - Offset commit — Only advances offset after successful write
- Transactional boundary — Write + offset commit in same transaction where possible
When syncflow.kafka.enabled=true, CDC events are published to Kafka topics instead of in-memory queues. This enables:
- Cross-pod event distribution
- Event replay from Kafka
- Decoupled producers/consumers
Topics are named {prefix}.{pipelineId} with configurable partitions and replication.