Quorum Replication
By Ankur NayakReviewed
Quorum replication keeps N copies of each piece of data and treats a write as successful once W of them confirm it, and a read as answered once R of them reply. Choosing W and R so that R + W > N means every read overlaps the latest write, while a minority of slow or failed replicas never blocks progress.
How it works
Store every item on N replicas. A write is sent to all of them but acknowledged once W have stored it; a read asks the replicas and waits for R answers. If R + W > N, any set of R replicas includes at least one that saw the latest acknowledged write. With N = 3, W = 2 and R = 2 is the classic choice: one replica can be down or slow and both reads and writes still succeed.
Real systems use the idea in different ways. Discord stores messages with a replication factor of three and reads and writes at quorum consistency. GitHub's DGit (now Spokes) streamed every write to three replicas and committed it once at least two confirmed. DynamoDB acknowledges a write once a quorum of a partition's replicas has persisted the log record.
Quorums can be leaderless or led. In leaderless designs such as Amazon's 2007 Dynamo, concurrent writes can create conflicting versions, which are tracked with vector clocks and reconciled during reads; Dynamo also used 'sloppy' quorums with hinted handoff to stay writable during failures. In leader-based designs such as DynamoDB and Spokes, one coordinator orders updates and the quorum decides when they are durable.
Replicas that miss writes drift. Systems detect drift (GitHub compares a checksum of each replica's references after every update), route reads away from lagging replicas, and repair them in the background.
Key points
- N copies, write quorum W, read quorum R
- R + W > N: every read overlaps the latest write
- N = 3, W = R = 2 tolerates one bad replica
- A minority of slow replicas doesn't block progress
- Detect and repair replicas that fall behind
When to use it, and pitfalls
Use it for
- Replicated databases and key-value stores
- Replicating files or repositories across servers
- Any store that must stay writable when one replica is down
Watch out for
- W = 1 or R = 1 trades consistency for speed; reads can be stale
- Sloppy quorums can let reads miss recent writes
- Concurrent writes without a leader need a conflict-resolution rule
- Replicas far apart make every quorum write pay a long round trip
Trade-offs
Strict vs relaxed quorums
Use R + W > N for data that must read its own writes; relax it where availability and latency matter more.
Pros: Strict: reads see the latest acknowledged write; Relaxed: lower latency, writable through more failures
Cons: Strict: needs a majority reachable; Relaxed: stale reads and conflicts to reconcile
Used in
Related building blocks
Frequently asked questions
What does R + W > N mean?
With N replicas, a write waits for W acknowledgements and a read for R answers. If R + W is greater than N, the replicas a read contacts must overlap the replicas that acknowledged the latest write, so the read can return the newest value.
Is a quorum the same as consensus?
Not quite. A quorum is the majority-overlap idea that both rely on. Consensus protocols such as Paxos and Raft add rules, like leaders, terms and log matching, so replicas agree on one ordered sequence of updates even under concurrent proposals and failures.
Sources
- Dynamo: Amazon's Highly Available Key-Value Store · SOSP (DeCandia et al.)
- How Discord Stores Trillions of Messages · Discord
- Introducing DGit · The GitHub Blog
- Stretching Spokes · The GitHub Blog