← Lessons

quiz vs the machine

Gold1360

System Design

The Replication Lag Impact

Why followers fall behind the leader, and the strange behaviors that lag produces for users.

5 min read · core · beat Gold to climb

What lag is

Replication lag is the delay between when the leader applies a write and when a follower applies the same write. With asynchronous replication this lag is normally tiny but can grow under load, network trouble, or a follower catching up after downtime.

Why it matters

If clients read from followers to scale read traffic, they may read stale data. The system is eventually consistent: given enough quiet time, followers converge, but at any instant they may show old values.

The user facing problems

Lag produces three classic anomalies that users notice:

  • A user writes data, then reads from a lagging follower and does not see their own write.
  • A user reads a fresh value, then reads again and sees an older value, as if time moved backward.
  • A user sees effects out of order, like an answer appearing before the question it replies to.

These are not bugs in the database. They are the cost of trading strong consistency for read scalability, and each has a targeted fix.

Key idea

Replication lag means follower reads can be stale, producing confusing anomalies that the system must explicitly guard against.

Check yourself

Answer to earn rating on the learn ladder.

1. What is replication lag?

2. Why can reading from followers return stale data?