Free preview

Leaderless Replication and Quorums

Why this matters: this is the model behind Dynamo-style systems, and the quorum inequality it rests on is one of the few pieces of distributed-systems math worth being able to derive on a whiteboard.

Key takeaway

Peer-to-peer (leaderless) replication eliminates the primary bottleneck entirely. All nodes have equal weight and can accept both read and write requests. Used by Dynamo-style databases such as Cassandra.

The model

Every node reads and writes all the data, and nodes communicate their writes to each other. There is no leader to fail, no failover to perform, and no election to get wrong.

Like multi-leader systems, leaderless replication allows concurrent writes, which can lead to inconsistency. The mechanism for managing that is quorums.

Quorums

Quorums ensure data consistency by requiring a minimum number of votes for operations to succeed. In a cluster of n nodes:

  • w — the minimum number of nodes that must acknowledge a write.
  • r — the minimum number of nodes queried for a read.

To guarantee strong consistency — reading the latest write — you must satisfy:

r + w > n

The reasoning is a counting argument. With n = 3, a write lands on 2 nodes and a read queries 2 nodes. Since 2 + 2 = 4 > 3, the two sets cannot be disjoint — they must share at least one node, and that shared node has the newest write. Violate the inequality and a read can land entirely on stale replicas.

These values are configurable in Dynamo-style databases, which is the real appeal: you tune consistency, latency, and availability per operation rather than per system.

Config (n/r/w)Legal?ReadsWritesBest for
3 / 2 / 1✗ — 2+1 is not > 3Rejected: quorums can miss each other
3 / 2 / 2BalancedBalancedGeneral-purpose default
3 / 1 / 3Fast — any nodeSlow — all three syncRead-heavy, write-rare data
3 / 3 / 1Slow — all threeFast — one nodeWrite-heavy, always-accept-the-write

Where leaderless fits

ModelWrite scalabilityFailover complexityConflict handlingConsistency
Single-leaderLimited — one writerElection plus fencing neededNone — leader serializesStrong on the leader
Multi-leaderBetter — several writersModerateRequired — avoidance, LWW, or mergeEventual
LeaderlessBest — every node writesNone — no leader to loseRequired — versioning plus quorumsTunable via r and w

The distinguishing property is the middle column. Leaderless has no failover story at all, because there is nothing to fail over — which removes the split-brain risk that makes single-leader automatic failover genuinely difficult.

Key takeaway

Leaderless trades a leader's simplicity for no single point of write failure and per-operation tunability. r + w > n is the invariant that makes it safe, and the numbers you choose are a statement about which you value more: fresh reads or fast writes.

Interview signal by level

LevelWhat a strong answer sounds like
L4"In a leaderless system any node can take reads and writes."
L5Knows the rule: "quorums with r + w > n so read and write sets overlap and the read sees the latest write."
Staff+Derives and tunes it: "the overlap is a counting argument — with n=3, w=2 and r=2 can't be disjoint. I'd run w=1 for the cart so writes are never rejected, and pay for it with r=3 there. And quorum latency is the slowest node in the set, not the average."

Next: what happens when the data no longer fits on one node.

Enjoying the preview?

Create a free account to unlock the rest of this course, the in-browser judge, and live AI mock interviews.

Sign up free to continue