Skip to main content
distributed systems

Quorum reads and writes

10 min read
Fully authored

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.

Interactive: N, R, W and their overlap
Write hits (W = 3)R1R2R3R4R5Read hits (R = 3)
R + W
6
N
5
Overlap
1
Strong reads?
✓ YES
R + W = 6 > N = 5. Overlap = 1 slot. The read set is guaranteed to intersect the write set. This is the industry-standard "quorum" setting.

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.
Four common quorum recipes
Write-heavy
N=5 · W=1 · R=5
Write
Fast
Read
Slow
Strong?
YES
1 ACK to commit. Reads must contact all 5. Great for event logging.
Read-heavy
N=5 · W=5 · R=1
Write
Slow
Read
Fast
Strong?
YES
All 5 ACKs to commit. Read hits any 1. Perfect for read-mostly documents.
Balanced QUORUM
N=5 · W=3 · R=3
Write
Medium
Read
Medium
Strong?
YES
The industry default. Symmetric latency, strong consistency.
Availability-only
N=5 · W=1 · R=1
Write
Fast
Read
Fast
Strong?
NO
1 ACK for both. NO consistency guarantee. Analytics, 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.

Pigeonhole visualization — N=5, W=3, R=3
5 replicasR1R2R3R4R5overlap!WR
W + R = 6 > N = 5, so overlap = 1. Write hit R1, R2, R3. Read hit R3, R4, R5. Both include R3 — the guaranteed overlap. R3 has the write, so the reader sees it. No coordination, no leader. Just arithmetic.

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.

DimensionQuorum systemsConsensus systems
SolvesRead-your-writes for many independent valuesAgreement on ONE value (leader, log entry)
CoordinationNone — leaderless, any replica coordinatesRequires an elected leader
Failure modelN=2f+1 tolerates f failures per quorumN=2f+1 tolerates f failures per group
OrderingNone across values — each is independentTotal order of log entries within group
Scales toBillions of independent keysOne tightly-coupled log per group
Latency1 hop (direct to replicas)2+ hops (client → leader → followers)
Conflict handlingLast-write-wins or vector clocks at read timeImpossible — leader serializes writes
Real usersDynamo, Cassandra, Riak, MongoDB WCetcd, 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.

Dynamo (2007)
Deep dive

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.

Read the deep dive →
Cassandra CL
Deep dive

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.

Read the deep dive →
MongoDB WC/RC
Deep dive

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.

Read the deep dive →
Elasticsearch
Deep dive

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.

Read the deep dive →
Riak
Deep dive

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."

Read the deep dive →
Voldemort
Deep dive

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.

Read the deep dive →

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.