Quorum Reads and Writes Explained
On this page
Three copies: how many do you wait for?
A key is stored on three replicas. When a client writes, should it wait for all three to confirm? Then one slow or dead replica blocks every write. Wait for one? Then a read that asks a different replica may return old data. Quorums give you a dial between those extremes.
Quorum math: N, W and R
- N: how many replicas hold each item.
- W: how many must acknowledge a write before it counts as successful.
- R: how many are asked on a read; the newest version among their answers is returned.
The key rule: if W + R > N, every set of replicas you read from overlaps every set that acknowledged the latest write in at least one replica, so a read always sees it. Checking every possible combination for N = 3:
N=3 W=2 R=2 W+R>N: True every read overlaps every write: True
N=3 W=1 R=1 W+R>N: False every read overlaps every write: False
N=3 W=3 R=1 W+R>N: True every read overlaps every write: True
N=3 W=1 R=3 W+R>N: True every read overlaps every write: True
Tuning quorum settings for consistency and latency
| Setting (N = 3) | Behavior | Fits |
|---|---|---|
| W=2, R=2 | Reads see the latest write; tolerates one replica down for both reads and writes | Balanced default |
| W=3, R=1 | Fast reads; any replica down blocks writes | Read-heavy, rarely written data |
| W=1, R=3 | Fast writes; any replica down blocks consistent reads | Write-heavy data, reads tolerate latency |
| W=1, R=1 | Fastest and most available; reads may be stale | Data where eventual consistency is fine (Day 6) |
Latency follows too: a request waits for the slowest of the W (or R) replicas it needs, so smaller numbers mean lower tail latency. Different operations in the same system can use different settings. Cassandra exposes this per query as consistency levels such as ONE, QUORUM and ALL; LOCAL_QUORUM keeps the quorum inside one data center to avoid cross-region latency.
LOCAL_QUORUM changes the overlap rule, though. A write with LOCAL_QUORUM in Europe and a read with LOCAL_QUORUM in the US each overlap only their own data center's replicas. They don't overlap each other, so the US read can miss a write Europe just confirmed. That's often acceptable, since most users read from the region they write to, but say so explicitly in the design.
What W + R > N doesn't promise
W + R > N gives you overlap, not full strong consistency. Edge cases remain:
- Failed partial writes: a write that reached one replica but not W may still be read by someone and not by others.
- Concurrent writes to the same key need conflict handling (Day 67) or last-write-wins.
- Sloppy quorums: some systems, when the home replicas are unreachable, accept writes on other nodes temporarily (hinted handoff). Availability improves, but the overlap guarantee no longer holds during that time.
Background repair closes gaps: read repair updates stale replicas noticed during reads, and anti-entropy processes compare replicas (often with Merkle trees) and fix differences.
Quorums in replication and consensus
The same thinking appears in database replication settings: waiting for one synchronous replica before confirming a commit is W = 2 out of a primary and replica. Consensus systems (Day 62) are a stricter relative: majority quorums plus a leader and ordered log give linearizable writes.
Check yourself
W = 3 and R = 3. W + R = 6 > 5, and each operation can proceed with two replicas down.
W + R doesn't exceed N, so a read can hit a replica that hasn't received the latest write and return a stale balance.
No. Each local quorum only overlaps replicas in its own region, so cross-region reads aren't guaranteed to see the latest write. Use a global quorum where that matters, accepting the latency.
Overlap ensures a read reaches at least one replica with the latest acknowledged write, but concurrent writes, sloppy quorums during failures and replicas with different clocks can still return surprising results. Linearizability needs extra mechanisms, such as read repair before returning or a consensus protocol.
With a smaller W, a write returns after fewer replicas confirm, so slow replicas don't hold it up. The cost is durability and consistency: if the replicas that acknowledged fail, the write may be lost, and reads with a small R may miss it.