Change Data Capture (CDC) lag is the time delay between a data modification being committed to a source database and that change being fully propagated and available for consumption in a downstream target system. This latency metric is fundamental to data freshness and is measured from the source's commit timestamp to the target's apply timestamp. High CDC lag indicates a replication pipeline is falling behind, risking stale data for analytics, machine learning features, or operational reporting.
Glossary
Change Data Capture (CDC) Lag

What is Change Data Capture (CDC) Lag?
Change Data Capture (CDC) lag is a critical latency metric in data engineering that measures the timeliness of data replication.
Monitoring CDC lag involves tracking the difference between the log sequence number (LSN) or timestamp of the last committed source change and the last processed event in the target. Causes of lag include source database load, network throughput limits, target system backpressure, and inefficient serialization/deserialization. Effective management requires setting Service Level Objectives (SLOs) for acceptable lag and implementing observability to trigger alerts when thresholds are breached, ensuring downstream data consumers operate on sufficiently current information.
Key Components of CDC Lag
CDC lag is not a monolithic delay but a composite of several distinct, measurable phases. Understanding each component is essential for diagnosing bottlenecks and setting precise Service Level Objectives (SLOs).
Source Commit Latency
This is the initial delay, measured from the moment a database transaction is initiated until it is durably committed to the source system's write-ahead log (WAL). Factors include:
- Database lock contention from concurrent writes.
- I/O performance of the underlying storage.
- Transaction size and complexity.
- Replication lag within the source database cluster (e.g., between a primary and its replicas). This component is internal to the source database and is often the first place to investigate for high baseline lag.
Log Read & Decode Delay
The delay incurred by the CDC tool as it reads the committed transaction from the source log (e.g., PostgreSQL WAL, MySQL binlog, MongoDB oplog) and decodes it into a structured change event. Key factors:
- Polling interval configuration of the CDC connector.
- Log decoding complexity, especially for heavily nested or encrypted data.
- Source database load impacting log read I/O.
- Network latency between the CDC agent and the database server (if reading remotely). Optimizing this stage often involves tuning connector configurations and ensuring the CDC process has low-latency access to the log.
Change Event Processing & Transformation
The time spent applying business logic to the raw change event before it is emitted. This can include:
- Schema transformation (renaming columns, changing data types).
- Filtering out irrelevant tables or operations.
- Masking or encrypting sensitive data (PII).
- Debezium's SMTs (Single Message Transformations) or equivalent logic. Complex transformations add computational overhead. This stage is a common source of data skew, where a few complex events slow down the entire pipeline.
Broker/Queue Propagation Time
The network and queuing delay as the change event travels from the CDC producer to the message broker (e.g., Apache Kafka, Amazon Kinesis) and through to the consumer. This encompasses:
- Network Round-Trip Time (RTT) between hosts.
- Broker acknowledgment wait time (acks=all for high durability).
- Internal broker queueing and partition leader election events.
- Consumer group rebalancing, which can temporarily pause consumption. Monitoring consumer lag on the target topic is the primary method for measuring this component.
Target Write & Commit Latency
The final delay, where the change event is applied to the destination system (e.g., data warehouse, search index, cache). This is often the most variable component and depends entirely on the target:
- Data warehouse load performance (e.g., Snowflake, BigQuery, Redshift).
- Indexing overhead in systems like Elasticsearch.
- Constraint checking and trigger execution in a target RDBMS.
- Rate limiting or throttling imposed by the target API. High latency here can cause backpressure, propagating delays back through the entire pipeline.
Monitoring & Observability Points
To measure each component, instrument these key metrics:
- Source Database: Transaction commit timestamps, WAL lag metrics.
- CDC Connector:
source_lag_metrics(Debezium),binlog_positionage. - Message Broker: Consumer lag (e.g., Kafka's
consumer_lag), end-to-end latency. - Target System: Ingestion latency, batch commit times.
- Business-Level SLOs: Define acceptable lag thresholds (e.g., "95% of changes available within 60 seconds") using tools like Grafana dashboards and Prometheus alerts. Correlate lag spikes with pipeline health events.
How is CDC Lag Measured and Monitored?
CDC lag is a critical operational metric for data freshness, quantified by comparing timestamps between source and target systems to identify propagation delays.
CDC lag is measured by calculating the difference between two timestamps: the commit time of a change in the source database and the processing or availability time in the target system. This delta, expressed in milliseconds or seconds, is the definitive lag metric. Monitoring systems track this value continuously, often exposing it as a gauge or time-series metric like cdc_replication_lag_seconds. Key related metrics include consumer lag in log-based systems and end-to-end latency, which encompasses the full pipeline.
Effective monitoring involves setting Service Level Objectives (SLOs) for acceptable lag thresholds and implementing alerts for breaches. Observability platforms visualize lag trends and correlate them with system health indicators like backpressure or data skew. For robust pipelines, checkpointing progress and handling late data via watermarks are essential complementary practices to ensure accurate lag measurement and system recovery.
Common Causes of High CDC Lag and Mitigations
A comparison of root causes for delays in Change Data Capture pipelines and corresponding technical mitigations to reduce latency.
| Cause / Symptom | Primary Impact | Typical Lag Increase | Recommended Mitigation |
|---|---|---|---|
Source Database Write Load Spikes | Overwhelms CDC connector's read capacity | Seconds to minutes | Increase connector parallelism; use database read replicas for CDC |
Network Latency or Instability | Increases time to transfer change logs | 100ms - 5+ seconds | Co-locate source and target in same cloud region; use dedicated network links |
Downstream Target Throttling/Backpressure | CDC process blocks on writes to destination | Minutes to hours | Implement adaptive batching; scale target system throughput |
Inefficient Connector Configuration (Batch Size, Poll Intervals) | Suboptimal resource utilization and idle time | Seconds to minutes | Tune batch size and poll intervals based on monitoring; enable heartbeat messages |
Schema Evolution or Large Transactions | Connector stalls parsing complex DDL or large TX logs | Minutes to hours | Pre-validate schema changes; monitor for oversized transactions |
Checkpointing Failures or Frequency | Connector reprocesses data from an old position on restart | Variable, can be large | Ensure durable, frequent checkpointing to a reliable store |
Data Skew in Partitioned Sources | A single hot partition becomes the processing bottleneck | Minutes, tail latency increases | Re-partition source table or configure parallel snapshotting |
Unhandled Poison Pill Messages or Deserialization Errors | Connector thread hangs or crashes, stopping progress | Indefinite until restart | Implement dead letter queues (DLQs) and robust error handling with alerting |
Frequently Asked Questions
Change Data Capture (CDC) lag is a critical latency metric in data engineering, measuring the delay between a source database transaction and its availability downstream. This FAQ addresses common technical questions about its measurement, impact, and mitigation.
Change Data Capture (CDC) lag is the time delay between when a data change (insert, update, delete) is committed to a source database and when that change is fully propagated and available for consumption in a downstream target system, such as a data warehouse, cache, or search index.
This lag is a composite metric influenced by multiple factors:
- Capture Latency: The time for the CDC mechanism (e.g., reading database transaction logs) to detect the change.
- Processing & Transformation Latency: The time spent parsing, filtering, or transforming the change event.
- Transmission Latency: The network transfer time to the target system.
- Loading Latency: The time for the target system to apply the change, which may involve conflict resolution or index updates.
Monitoring CDC lag is essential for ensuring data freshness and meeting Service Level Objectives (SLOs) for real-time analytics and operational systems.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
CDC lag is a critical component of a broader data latency landscape. Understanding these related concepts is essential for diagnosing bottlenecks and setting realistic performance targets.
Data Freshness
Data freshness is a measure of how up-to-date a dataset is, defined as the time elapsed between when a real-world event occurs and when that event's data is available for querying or processing in a target system. It is the business-facing metric derived from underlying technical latencies like CDC lag.
- Key Distinction: While CDC lag measures the technical delay in a specific replication process, data freshness is the end-user or application's experience of that delay.
- Example: A dashboard showing sales figures from '5 minutes ago' indicates a data freshness of 5 minutes, which may be the sum of CDC lag plus downstream transformation time.
End-to-End Latency
End-to-end latency is the total elapsed time from the occurrence of an event at the source to the completion of its processing and availability for consumption in the final destination system. CDC lag is a primary component of this total.
- Composition: It aggregates multiple delays: source commit time, CDC capture and propagation lag, network transmission, target ingestion processing, and any downstream transformation or aggregation.
- Monitoring Focus: Engineering teams track end-to-end latency with Service Level Objectives (SLOs) to guarantee overall system performance, using CDC lag as a key leading indicator for troubleshooting.
Consumer Lag
Consumer lag is the delay, measured in time or number of unprocessed messages, between the most recent message produced to a log-based system like Apache Kafka and the last message consumed by a specific client application. In CDC architectures using change logs, consumer lag directly reflects the propagation delay.
- Measurement: Typically monitored as lag in milliseconds or number of offset messages.
- Direct Correlation: High consumer lag in the CDC connector's consumption of database transaction logs is a direct manifestation of CDC lag. It signals that the capture process cannot keep pace with the source write rate.
Event Time vs. Processing Time
Event time is the timestamp indicating when an event or transaction actually occurred in the real-world source system. Processing time is when the event is observed by the data pipeline. The delta between them is a core measure of latency, including CDC lag.
- CDC Lag Context: The
commit_timestampon a source database record is its event time. The timestamp when the CDC agent reads that log entry is its processing time. - Impact on Analytics: For accurate time-windowed aggregations (e.g., 'sales per hour'), systems must use event time. CDC lag can cause late data that arrives after the window's watermark has passed, requiring specific handling logic in stream processors.
Service Level Objective (SLO)
A Service Level Objective (SLO) is a specific, measurable target for the reliability or performance of a service. For CDC pipelines, SLOs are defined for metrics like P99 CDC Lag or Data Freshness.
- Example SLO: '99% of propagated database changes must be available in the data warehouse within 60 seconds of source commit.'
- Engineering Use: SLOs create a formal, business-aligned threshold for acceptable lag. Breaching an SLO triggers alerts and incident response, focusing engineering effort on the most impactful latency issues.
Backpressure
Backpressure is a flow control mechanism in data streaming systems where a fast data source is signaled to slow down its emission rate to match the processing capacity of a slower downstream consumer. It is a critical concept for managing CDC lag.
- Cause of Lag: If a target system (e.g., a data warehouse) ingests changes slower than the source produces them, backpressure builds in the pipeline, increasing CDC lag.
- Mitigation Strategies: Addressing backpressure may involve scaling consumer resources, optimizing target write patterns, or implementing circuit breakers to prevent cascading failures.

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.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us