Inferensys

Glossary

Change Data Capture

Change Data Capture (CDC) is a software design pattern that identifies, tracks, and delivers row-level modifications (inserts, updates, deletes) made to source data in operational databases, enabling real-time synchronization with downstream systems.
Data scientist building training data pipeline on laptop, data preprocessing visible, technical workspace.
REAL-TIME DATA SYNCHRONIZATION

What is Change Data Capture?

Change Data Capture (CDC) is a software design pattern that identifies, tracks, and delivers row-level data modifications—inserts, updates, and deletes—from a source database to downstream systems in real time.

Change Data Capture is a method for ingesting database mutations by reading the transaction log, avoiding the latency and load of batch queries. It captures every INSERT, UPDATE, and DELETE as an event, enabling immediate synchronization of the online store with operational systems.

In feature engineering, CDC ensures feature freshness by streaming changes directly to the materialization pipeline. This guarantees that point-in-time correctness is maintained and that models serve vectors reflecting the current state of the entity, not a stale snapshot.

DATA INGESTION PATTERNS

Key Characteristics of CDC

Change Data Capture provides a low-latency mechanism for detecting and propagating row-level mutations from operational databases into analytical and serving systems.

01

Log-Based Capture

The most efficient CDC method reads directly from the database transaction log. This approach captures INSERT, UPDATE, and DELETE operations with minimal impact on source system performance. Unlike trigger-based methods, log-based CDC does not require schema changes to operational tables.

  • PostgreSQL: Uses logical replication slots and the WAL (Write-Ahead Log)
  • MySQL: Consumes the binlog via connectors like Debezium
  • SQL Server: Leverages the native transaction log via LSN (Log Sequence Number)
< 1 ms
Overhead on Source
Sub-second
Propagation Latency
02

Schema Evolution Handling

CDC pipelines must gracefully manage schema drift in the source database without breaking downstream consumers. When a column is added or a data type is widened, the CDC connector emits a schema change event to update the registry.

  • Avro and Protobuf serialization with a schema registry ensure backward compatibility
  • Dead Letter Queues route malformed records for inspection without halting the stream
  • Feature Store Integration: Updated schemas trigger automatic re-materialization of affected feature groups
03

Exactly-Once Semantics

Ensuring that every row mutation is processed exactly once is critical for maintaining accurate feature values in the online store. CDC pipelines coordinate offsets between the source log and the downstream sink.

  • Idempotent Writes: Feature stores use upsert operations keyed by entity ID and timestamp
  • Two-Phase Commit: Kafka Connect sinks flush offsets only after the target system acknowledges the write
  • Deduplication: Ingested events carry a unique transaction ID to filter out replayed records
04

Filtering and Transformation

Not every database change is relevant for feature engineering. Single Message Transforms (SMTs) and stream processors filter and reshape events before they reach the feature store.

  • Column Filtering: Drop sensitive PII columns or irrelevant metadata before ingestion
  • Routing: Dispatch events to different topics based on table name or operation type
  • Enrichment: Join CDC events with static reference data to hydrate foreign keys into human-readable values
05

Snapshot vs. Streaming Mode

CDC connectors operate in two distinct phases. An initial snapshot captures the full state of a table, followed by continuous streaming of incremental changes.

  • Snapshot: Acquires a consistent read lock to export all existing rows with their current values
  • Streaming: Transitions seamlessly to tailing the transaction log after the snapshot completes
  • Resumption: If the connector fails, it resumes from the last committed log offset without re-snapshotting
CHANGE DATA CAPTURE

Frequently Asked Questions

Explore the core concepts of Change Data Capture (CDC), a critical pattern for streaming row-level mutations from operational databases into real-time feature stores to power low-latency online inference.

Change Data Capture (CDC) is a data integration pattern that identifies, captures, and delivers row-level changes—INSERT, UPDATE, and DELETE operations—made to source database tables in real-time. Instead of relying on bulk batch extracts that snapshot entire tables, CDC monitors the database's transaction log (such as MySQL binlog, PostgreSQL WAL, or SQL Server transaction log) to detect mutations as they are committed. When a row changes, the CDC system immediately serializes the event into a structured message, typically JSON or Avro, and publishes it to a distributed streaming platform like Apache Kafka. Downstream consumers, such as a feature store's online serving layer, ingest these events to update specific feature values—like a user's last-clicked product or a real-time inventory count—with minimal latency, often measured in milliseconds. This log-based approach is non-intrusive to the source application, ensuring that operational database performance remains unaffected while providing a continuous, ordered stream of truth for machine learning pipelines.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.