← Back to microservices patterns map
👂
Microservices Pattern

Change Data Capture (CDC)

Capture database changes and publish them as events.

CDC

Detailed Description

CDC watches the database transaction log rather than relying on application code to publish events.

It is commonly used for outbox publishing, projections, search indexes, and analytics streams.

Visual Diagram

DB commit -> transaction log
CDC connector -> event stream
Consumers update projections

Tradeoffs

Pros

Low app-code change, reliable change stream

Cons

Operational complexity and schema evolution

Examples: Debezium, Kafka Connect, database logs