How do quorum reads and writes work, and why does R + W > N matter?
HardConceptCAP, Consistency & Availability
Answer
In leaderless replication, each item is stored on N replicas. A write succeeds once W replicas acknowledge it, and a read queries R replicas and keeps the newest version. If R + W > N, every read set overlaps every write set, so at least one replica consulted by a read holds the latest acknowledged write.
- Common choice: N = 3, W = 2, R = 2 tolerates one unavailable replica for both reads and writes.
- Tuning: W = N with R = 1 gives fast reads, but writes fail if any replica is down; small R and W favour latency and availability over consistency.
- Caveats: sloppy quorums, concurrent writes and partially failed writes can still expose stale values, so quorums alone do not guarantee linearizability.
- Read repair and background anti-entropy bring lagging replicas up to date.
More in CAP, Consistency & Availability
| # | Problem | Platform | Difficulty | Open | 1st1st Visit | 2nd2nd Visit | RevRevise |
|---|---|---|---|---|---|---|---|
| 1 | What is the CAP theorem? | Concept | Easy | Read the answer to What is the CAP theorem? | |||
| 2 | What is the difference between strong consistency and eventual consistency? | Concept | Medium | Read the answer to What is the difference between strong consistency and eventual consistency? | |||
| 3 | How is availability measured, and what do SLAs, SLOs and the 'nines' mean? | Concept | Medium | Read the answer to How is availability measured, and what do SLAs, SLOs and the 'nines' mean? | |||
| 4 | How do quorum reads and writes work, and why does R + W > N matter? | Concept | Hard | Read the answer to How do quorum reads and writes work, and why does R + W > N matter? |