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 with explicit health classifications.

Reviewed by the Telemetry product team on . Read-only SQL, connected-table grain, deterministic result, visualization, and interpretation boundaries. Review standards and ownership

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 with explicit health classifications.

The dataset and query remain in this browser.

Published 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.

Decisions the SQL cannot make

  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.

Continue from this lesson