Database Replication Lag Catch-up Calculator
Estimate how long a replica needs to catch up, accounting for writes that continue arriving while it applies the backlog.
Uses decimal GB and constant throughput rates. Maintained by Buildopsy · Updated .
Replica recovery scenario
Formula and assumptions
Net catch-up rate = replica apply MB/s − primary write MB/s. Catch-up seconds = lag GB × 1,000 ÷ net catch-up MB/s.
If the net rate is zero or negative, lag does not clear under the current steady-state rates. The estimate assumes backlog bytes are representative of apply work and ignores bursts, compression, transaction overhead, replication slots, disk contention, and changing rates. Monitor actual lag and apply metrics during recovery.
Frequently asked questions
How is replication catch-up time calculated?
The outstanding bytes are divided by spare apply throughput after ongoing writes are accounted for. Rates and lag must use consistent byte units.
What if apply throughput is below the write rate?
Lag grows or remains level. Reduce the primary write load or increase replica throughput before expecting recovery.
Related calculators
All engineering calculators · Database storage growth forecast · Connection pool sizing · Queue backlog drain time

