RDS Read Replica Replication Lag

Diagnose and reduce replication lag on RDS read replicas to ensure data freshness for reads.

Overview

Overview

RDS read replica replication lag is how far behind the primary a replica is, in seconds. It matters for every application that offloads reads to replicas, because a lagging replica serves stale data, causing user-visible inconsistencies and subtle bugs.

Replication is a pipeline, and lag builds up at its slowest stage. The figure follows one write from the application to the metric that reports the lag.

Key concepts

  • ReplicaLag
  • Parallel Replication
  • pt-online-schema-change
  • gh-ost
  • Read-Your-Writes Consistency

Interview questions

  • Why does a single large transaction cause a replica lag spike, and what is the correct fix?
  • How do you implement read-your-writes consistency when using RDS read replicas?
  • What is the difference between pt-online-schema-change and gh-ost, and when should you use each?

Sign up free to read the full topic

More Troubleshooting topics

Start free on Cariara · Coding problems · System design studio