Topic 130 / Advanced
Quorums
Chapter 8.2 · Consistency Theory
What and why
Leaderless replication (→ 72) lets any of N replicas accept a read or write, but without a leader something must still guarantee that reads see recent writes. A quorum is the minimum number of replicas that must participate in an operation for it to count as succeeded. Requiring a write quorum W and a read quorum R out of N replicas such that W + R > N guarantees, by the pigeonhole principle, that any read quorum overlaps any write quorum in at least one replica — so at least one replica in the read set always holds the latest acknowledged write. Builds on: → 74 (consistent hashing — the mechanism that decides which N nodes hold a given key's replicas).
Diagram
N = 3 replicas: A, B, C
Write (W=2): A ✓ B ✓ C .
Read (R=2): A . B ✓ C ✓ ← overlaps the write set at B
W + R = 4 > N = 3 → overlap guaranteed, size ≥ W + R − N = 1
How it works
- Fix N (replicas per key, assigned via consistent hashing → 74), then choose W and R so that W + R > N for a "strict quorum."
- A write succeeds once W replicas acknowledge it; a read succeeds once R replicas respond, and the coordinator returns the most recent value among them (by timestamp or version → 134).
- Pigeonhole guarantee: any W-subset and any R-subset drawn from the same N must share at least W + R − N members — if W + R > N, that overlap is at least 1.
- If W + R ≤ N, no overlap is guaranteed — a read can land entirely on replicas that haven't yet received the latest write, returning stale data with no warning.
- A sloppy quorum relaxes which nodes count: if a key's designated N nodes aren't reachable (→ 126), the write is accepted on any W reachable nodes instead, trading the strict-overlap guarantee for availability — repaired later by hinted handoff (→ 131).
- Lower W and higher R favors fast, available writes with slower, more consistent reads; the reverse is also valid — the two numbers are a latency/consistency dial.
Practical example
(illustrative; arithmetic exact). N = 3, W = 2, R = 2: W + R = 4 > N = 3, so overlap ≥ W + R − N = 1 — any 2-of-3 write set and any 2-of-3 read set share at least one replica. Contrast N = 3, W = 1, R = 1: W + R = 2 ≤ N = 3, so overlap ≥ 0 — a write acknowledged by one replica and a read answered by a different single replica can legitimately miss each other entirely, returning stale data with no error.
When to use it
- Use when: a leaderless, multi-replica store where no single node is authoritative and both read and write availability matter more than a single coordinator.
- Avoid when: a single leader (→ 72 leader–follower) already gives linearizable reads/writes more simply — quorums solve a problem that doesn't exist without a leaderless design.
- Failure scenarios: choosing W + R ≤ N believing "most replicas" is enough, then seeing unexplained stale reads under normal operation, not just during a partition; sloppy quorums silently weakening the overlap guarantee during exactly the window a partition makes correctness matter most.
- Simpler alternative: a single leader with synchronous replication to one follower, when N is small and a leader is acceptable.
Practice
(Numeric kind — drills with a verified answer key; 20 min, no lab services).
- N=5, W=3, R=3 — does a strict quorum hold, and what's the guaranteed overlap?
- N=5, W=2, R=2 — same question.
- N=7, W=4, R=4 — same question.
- N=3, W=1, R=1 — same question.
- N=4, W=2, R=2 — same question.
Answer key.
- W+R=6 > 5 → holds; overlap ≥ 6−5 = 1.
- W+R=4 < 5 → fails; overlap ≥ 0 — no guarantee.
- W+R=8 > 7 → holds; overlap ≥ 8−7 = 1.
- W+R=2 < 3 → fails; overlap ≥ 0 — no guarantee.
- W+R=4 = 4 → fails — equality is not enough, the rule is strictly W+R > N; overlap ≥ 0.
Done when all five match this key and you can explain, in one sentence, what "overlap ≥ 0" means for a reader.
Key takeaway
W + R > N guarantees every read quorum overlaps every write quorum by at least W + R − N replicas; W + R ≤ N trades that guarantee away, usually unintentionally. Done when you can: compute the overlap for any stated N/W/R and say whether it guarantees seeing the latest write. Used next in → 131; Capstone.
References
DeCandia et al., "Dynamo: Amazon's Highly Available Key-value Store" — see
references.md. Kleppmann and Riccomini, Designing Data-Intensive Applications — see
references.md.