Work out replication lag instantly with clear inputs, formula shown and shareable results.
Lag accumulates whenever the primary writes faster than the replica applies, and the backlog grows linearly with the deficit and burst duration. Because catch-up is also limited by apply throughput, a 20-minute burst with a 7 MB/s deficit takes minutes to clear after the burst ends — which is why replica lag alerts fire long after the write spike is over.
Replication lag
deficit = write rate - apply rate; backlog = deficit x burst duration; lag = backlog / apply rate; steady lag = network latency + one apply interval
The primary writes with many concurrent sessions while a naive replica replays serially, so apply throughput is a fraction of write throughput. Parallel apply by schema or by transaction dependency fixes this.
Only if the application tolerates stale reads. For read-after-write consistency, route those reads to the primary or use a session-level consistency token.