Skip to content
Telemetry
Interactive SaaS SQL lab

Database reliability · Beginner

Monitor database replication and consumer lag

Which downstream database consumer is falling behind?

Compare replica, CDC, and search-consumer lag against health thresholds.

Reviewed by the Telemetry product team on . We checked the read-only SQL, table joins, sample results and chart, and what the results mean. Who reviews this page

Runs against one versioned 15-table dataset

Edit and execute the query locally in your browser, then download the same synthetic schema and rows for DuckDB.

Database reliabilityBeginner

Monitor database replication and consumer lag

Which downstream database consumer is falling behind?

Compare replica, CDC, and search-consumer lag against health thresholds.

The dataset and query remain in this browser.

Expected result

Maximum replication lag

consumer_namesource_typemax_lag_secondsaverage_lag_secondsunhealthy_samples
warehouse_cdccdc_pipeline12051.82
read_replica_uspostgres_replica186.81
search_indexsearch_replica106.30

How to read the query

  • A shared consumer model makes operational replicas and asynchronous pipelines comparable.
  • Maximum lag captures the worst user-visible staleness in the sample window.
  • Health classifications can encode consumer-specific thresholds without hiding raw lag.

How to interpret the results

  1. 1Prioritize consumers with both high lag and repeated unhealthy samples.
  2. 2Use backlog bytes to distinguish low-throughput staleness from sustained ingestion pressure.
  3. 3Set different service-level objectives for read replicas, CDC, and search indexes.

Related lessons

Keep the result

Run this query on your own events

Create a free workspace only when you are ready to save the query, connect real events, and monitor the result. No credit card is required.

Save with my events