← Playground

Quorum Lab

royhp.com

A leaderless (masterless) cluster has no primary — every replica is equal and any node can coordinate a request. This is the design behind Amazon DynamoDB, Apache Cassandra and Riak. A value is copied to N replicas; a write waits for W acknowledgements and a read waits for R responses. The golden rule: when R + W > N the read and write quorums are forced to overlap, so every read is guaranteed to see the latest committed write.

R + W > N
quorums overlap → reads see the latest write
W 3 R 3 N 5 overlap ≥1
Tap a node to
Speed 1.5×
write quorum read quorum overlap (sees latest) stale replica down
Write latency
W-th fastest ack
Read latency
R-th fastest reply
Last operation
ready
press “Do a write”
Read result
consistent vs stale
Writes tolerate
2
N − W failures
Reads tolerate
2
N − R failures
Stale replicas
0
behind latest write
Live replicas
5
of 5 up

Leaderless replication

In a Dynamo-style cluster there is no master to funnel writes through. Each key lives on a preference list of N replicas (chosen by consistent hashing), and whichever node a client reaches acts as coordinator, fanning the request out to the replicas peer-to-peer. There is no failover, no election, no single bottleneck — losing a node just shrinks the set you can reach.

Each replica stamps its copy with a version / timestamp. Here we use last-write-wins by version; real systems may carry vector clocks to detect concurrent writes that need merging.

The R + W > N rule

A write is durable once W replicas ack; a read collects R replies and keeps the newest version it sees. Two subsets of an N-node set whose sizes sum to more than N must share at least one member — so when R + W > N the read quorum is guaranteed to overlap the write quorum and catch the latest value. Drop below the line and a read can land entirely on replicas that missed the write, returning stale data.

This makes consistency tunable: Cassandra’s QUORUM / LOCAL_QUORUM, DynamoDB’s strong vs eventual reads, and Riak’s per-request r / w all dial the same knob. Writes survive N − W failures, reads survive N − R.

Read repair & availability

When a read notices a replica holding an old version, the coordinator pushes the newest value back to it — read repair — so popular keys self-heal. Background anti-entropy (Merkle-tree sync) and hinted handoff mop up the rest. Watch stale nodes flip to the latest version after a read passes through them.

If too many replicas are down or cut off by a network partition, a quorum can’t be reached and the operation fails — the availability cost of strong quorums. Kill nodes, split the cluster, and watch writes or reads stall when fewer than W (or R) replicas remain reachable.