Skip to content
Optimal Lab

System design · interactive

Eventual consistency and quorums

Data is copied to 3 replicas, which apply a write at different speeds. A write is acknowledged after W replicas have it; a read asks R replicas and keeps the newest. If R + W > N, every read overlaps the latest write.

write name = "Ada L." at 0 ms · acknowledged at 0 ms · read at 100 ms

replica 1 · lag 0 ms

Ada L. (v2)

replica 2 · lag 40 ms

Ada L. (v2)

replica 3 · lag 400 ms

Ada (v1)

asked by the read

read returns v1: stale

R + W = 2 ≤ N = 3: a read can miss the write. This shows the worst case: the read hits the slowest replicas.

With R + W ≤ N, the read can land only on replicas that haven't caught up. Wait longer and it converges.

  1. 1

  2. 2

  3. 3

    W=1 writes and R=1 reads are fastest and most available, and the most likely to be stale.

    Fine for likes and view counts.

  4. 4

In production

Tools and technologies

Leaderless stores let you tune R and W per query.

Not tied to one language — use these names when you search docs or design a system.