Quorum reads and writes
The R+W>N formula that makes eventually-consistent stores feel consistent.
You have 5 copies of a value, one on each of 5 servers. A client writes a new value. It sends the update to some subset of the copies, then returns success. Another client immediately reads the value, from another subset. What guarantee can you make about what the reader sees?
This is the quorum problem, and it has a beautifully simple answer: if R + W > N, every read sees at least one copy of the latest write. Not "usually." Not "most of the time." Every read. That inequality is the foundation of every eventually-consistent database that offers "strong reads" — Dynamo, Cassandra, Riak, MongoDB (write concern + read concern), Elasticsearch. All of them.
The proof takes 10 seconds. If a write hits W of N copies, and a read hits R of N copies, then by the pigeonhole principle the write set and the read set must overlap in at least R + W − N copies. If R+W>N, that overlap is at least 1 — meaning the reader sees at least one copy that has the write. Dynamo-style stores tag every value with a timestamp; the reader picks the latest and returns it. Strong read guarantee, no coordinator, no leader.
The paper
Gifford (1979) — "Weighted Voting for Replicated Data." SOSP 1979. David Gifford at Xerox PARC introduced weighted voting quorums for the Xerox file system. The idea sat mostly unused for 25 years until Amazon's Dynamo paper (DeCandia et al., 2007) revived it for eventual-consistency stores at internet scale.
Interactive: the R + W > N slider
Move the sliders. Watch the overlap between the read set and the write set change. When R+W>N, the sets overlap. When R+W ≤ N, they don't — and you can read stale data.
The two knobs — R and W independently
The beauty of quorum systems is that you can pick R and W per request. Both writes and reads have a latency-consistency-availability triangle. The two knobs let you slide along it independently:
- Write-heavy workload — W=1 (fast writes), R=N (slow reads that see everything). Event logging lands here.
- Read-heavy workload — W=N (slow writes, maximum durability), R=1 (fast reads). Read-mostly documents.
- Balanced OLTP — W=⌈N/2⌉+1, R=⌈N/2⌉+1 (both quorum). Symmetric latency, strong consistency. Industry default.
- Availability-only — W=1, R=1. Fast on both paths. No consistency guarantee. Analytics or metrics.
The proof visualized — pigeonhole
Here's why R+W>N is a mathematical guarantee, not a probabilistic one. N=5 replicas. A write hits W=3 of them (blue). A subsequent read hits R=3 of them (yellow). The 5 slots contain 3+3=6 "hits" total. If they didn't overlap anywhere, you'd need 6 slots — but only 5 exist. So they must overlap in at least 1 slot. That slot has the write, so the reader sees it.
Sloppy quorum — the availability trick
Strict quorum has a problem: if 3 of your 5 replicas are down, you can't achieve W=3. Requests fail. Dynamo introduced sloppy quorum to preserve availability during partial failures: if a write can't reach W of the designated replicas, it writes to nearby healthy nodes instead (called hinted handoff). When the intended replicas come back, the hint is replayed. Sloppy quorum preserves availability but weakens consistency — a subsequent read might hit only the intended replicas and miss the value entirely.
Quorum is not the same as consensus
Quorum systems and consensus systems (Raft, Paxos) both use majorities. Both tolerate f failures with N=2f+1. But the similarities end there.
| Dimension | Quorum systems | Consensus systems |
|---|---|---|
| Solves | Read-your-writes for many independent values | Agreement on ONE value (leader, log entry) |
| Coordination | None — leaderless, any replica coordinates | Requires an elected leader |
| Failure model | N=2f+1 tolerates f failures per quorum | N=2f+1 tolerates f failures per group |
| Ordering | None across values — each is independent | Total order of log entries within group |
| Scales to | Billions of independent keys | One tightly-coupled log per group |
| Latency | 1 hop (direct to replicas) | 2+ hops (client → leader → followers) |
| Conflict handling | Last-write-wins or vector clocks at read time | Impossible — leader serializes writes |
| Real users | Dynamo, Cassandra, Riak, MongoDB WC | etcd, Consul, CockroachDB, Kafka KRaft |
Rough rule of thumb: use consensus when you need one agreed-upon value (leader, metadata state, log entry). Use quorums when you need many independently-updated values (user rows, cache entries, counter shards). Consensus doesn't scale to millions of objects; quorums don't give you a total order across objects.
Applied in real systems
Every quorum-based store below made a specific choice about R, W, N, sloppy quorum, and conflict resolution.
Amazon Dynamo — the reference quorum store
N=3, W and R configurable per bucket, sloppy quorum for availability, hinted handoff for hint replay, Merkle-tree anti-entropy for long-term convergence. The paper (DeCandia et al., SOSP 2007) is the architecture every other Dynamo-style database copies.
Cassandra — CL per query
Consistency Level (CL) is picked per-request: ONE, QUORUM, ALL, LOCAL_QUORUM. RF is fixed per table; CL is negotiated per query. A single cluster can serve both fast CL=ONE analytics reads and strong CL=QUORUM transactional reads.
MongoDB — writeConcern + readConcern
MongoDB layers quorum semantics on top of Raft replica sets. w:"majority" writes wait for a majority; readConcern:"majority" returns only committed data. Together = linearizable.
Elasticsearch — write consistency
Each shard has 1 primary + N replicas. Writes go to the primary, which replicates. The old write_consistency knob let you specify quorum semantics; today it's wait_for_active_shards.
Riak — the purest Dynamo clone
Basho's open-source Dynamo. N/R/W/PR/PW/DW knobs per bucket. Sloppy quorum toggleable. Explicit vector-clock conflict resolution. The reference implementation for "how to build a Dynamo-style database from scratch."
Voldemort — LinkedIn's Dynamo
LinkedIn open-sourced Voldemort in 2009 as their internal Dynamo variant. Backed member profile store for years. N/R/W tunables. Superseded internally at LinkedIn since ~2013 but historically important.
Key takeaways
- R + W > N guarantees every read sees the latest write — by pigeonhole, not probability.
- The overlap is R + W − N copies. Pick R=W=⌈N/2⌉+1 for symmetric latency; skew for asymmetric workloads.
- Quorum ≠ Consensus. Quorums handle many independent values (KV). Consensus handles one agreed value (leader). Different tools.
- Sloppy quorum (Dynamo, Riak, Cassandra) trades consistency for availability during partial failures.
- Quorum alone doesn't handle conflict — it needs a resolution rule: vector clocks or last-write-wins timestamps at read time.
- Every distributed database calls R=W=⌈N/2⌉+1 "QUORUM." Industry-standard OLTP default.
References
- Gifford (1979) — Weighted Voting for Replicated Data. SOSP 1979.
- DeCandia et al. (2007) — Dynamo: Amazon's Highly Available Key-value Store. SOSP 2007.
- Lakshman & Malik (2010) — Cassandra: A Decentralized Structured Storage System.
- Kleppmann (2017) — Designing Data-Intensive Applications, Ch. 5.
- Werner Vogels — "Eventually Consistent." Amazon blog, 2008.
Practice what you just read
Every foundation concept has a companion quiz to close the loop.