You've got 5 replicas. How many do a read and a write each need to touch so that a read can never miss the latest write — without waiting for all 5 every time?
Drag R and W. Notice: some combinations guarantee that any read quorum and any write quorum you could pick are forced to share at least one node. Others leave a gap — a read could land entirely on nodes the write never reached.
A quorum system replicates to nodes and requires a write to succeed on of them, a read to be answered by of them. Reads and writes are safe together exactly when:
- — total number of replicas.
- — how many replicas a write must reach before it's considered done.
- — how many replicas a read must query before it returns an answer.
- Why the inequality works
Out of nodes, a write quorum covers of them and a read quorum covers of them. If , there simply aren't enough "empty" slots left for the two quorums to avoid each other — by the pigeonhole principle they must share at least one node.
- That shared node is the guarantee
Whatever node sits in the overlap has the latest write, because the write quorum included it. So any read quorum is guaranteed to see it too.
Watch the readout compute directly — the overlap margin. Positive means safe, zero or negative means a read and a write could pick disjoint sets of nodes and a stale read slips through.
, and you choose , :
- Pick concrete quorums
Label the replicas 1–5. Say the write quorum is and the read quorum is .
- Find the overlap
They share node — whatever the write left there, the read sees it.
- Check the margin
A margin of exactly 1 means every possible pair of a 3-node read quorum and a 3-node write quorum out of 5 shares at least one node — not just this particular pair.
- Contrast with an unsafe choice
gives a margin of : a read quorum like and a write quorum like share nothing, so the read could miss the write entirely.
N is fixed at 5. Find R and W that guarantee overlap while contacting the fewest nodes possible — i.e. R + W is exactly one more than N.
A quorum system replaces "wait for the one primary" with "wait for enough replicas to overlap." Any and satisfying guarantee a read always sees the latest committed write — and the smallest safe choice, , gets that guarantee while touching the fewest nodes possible.