Try
↑ ↓ move↵ openesc close

Quorums lab

Write to W of N replicas, read from R of them. Tune R and W, break nodes, slow some down, and see staleness, latency and availability trade against each other.

R + W = 2 + 2 = 4N = 5a read set can miss the replicas that took the write

R=2, W=2 · R+W ≤ N

  • #1 slowv84behind
  • #2v86current
  • #3v86current
  • #4v85behind
  • #5v86current

Last write: 10.8 ms. Outlined cells counted toward the last quorum. Dashed cells were unreachable.

stale reads
0.7%
reads answered
100%
writes accepted
100%
read p50 / p99
6.5 / 17.4ms
write p50 / p99
6.8 / 17.4ms
Stale reads, last 2 s
Stale reads, last 2 s. Text version available below the chart.0%25%50%75%100%t=0st=2st=4ssimulated timeshare of reads

What to try

Each one sets up a starting point. Then make the change it describes.

  1. The overlap rule

    Turn off failures and slow replicas, then compare R=2, W=2 with R=3, W=3 on five replicas.

    Look for. With R+W at most N a read can land on replicas that missed the latest write, so some reads are stale. With R+W above N every read set shares a replica with every acknowledged write, and stale reads drop to zero.

  2. Four settings side by side

    Pick Compare all R and W settings with five replicas, one slow, 5 percent unreachable. Compare read and write latency across the four.

    Look for. R=1, W=1 is fastest and stalest. Majority quorums never read stale and cost more. Making W=N makes reads cheap but writes wait for the slowest replica, and R=N does the opposite.

  3. The slow node problem

    Set two slow replicas, then raise R and W from 3 to 4 to 5 and read the p50 latency.

    Look for. With three fast replicas, R=3 and W=3 can skip the slow ones. One more and the operation has to wait for a slow replica, so latency jumps by several times.

  4. Failures and availability

    Set 25 percent unreachable and compare all settings. Look at writes accepted and reads answered.

    Look for. Needing every replica fails most operations, since one down node is enough to block it. Needing only one almost never fails. Majority sits between the two.

  5. Sloppy quorum, then read repair

    Use R=3, W=3 with 25 percent unreachable. Switch to Sloppy quorum with hints and read the stale rate. Then try Read repair with R=1, W=1.

    Look for. A sloppy quorum accepts writes on stand-in nodes, so writes keep succeeding, but reads of the home replicas can miss them until the hint is handed back. Read repair pushes the newest value to replicas that answered with an old one, which lowers staleness.

New to the idea? Read the lesson first. Every number here comes from a seeded simulator, so the same seed gives the same run.

Your progress is saved in this browser. Sign in to keep it on every device. Privacy · Terms