What it is
Leaderless replication drops the idea of a leader altogether. Each key is stored on N replicas (chosen by a consistent-hash ring), and any of them accepts reads and writes. A coordinator, either the client's driver or whichever node received the request, sends each write to all N replicas in parallel and each read to several of them. The design comes from Amazon's 2007 Dynamo paper and is used by Cassandra, ScyllaDB and Riak.
Why it exists
Leader-based systems have a special node: when it fails, writes stop until failover elects or promotes a new one, which takes seconds to minutes and can lose or duplicate writes if done carelessly. Leaderless replication has no such node. A replica failure is routine: writes go to the others and succeed as long as enough replicas answer. It was built for "always writable" workloads such as shopping carts.
How it works
Writes go everywhere. The coordinator sends the write to all N replicas and reports success once W have confirmed (the quorum lesson covers choosing W and R). Each value carries a version (a timestamp or a version vector) so that replicas and readers can tell newer from older.
A down replica falls behind. With N = 3 and W = 2, a write succeeds while one replica is down, but that replica misses it. When it returns it holds old values. Three mechanisms catch it up, each with a different scope.
Hinted handoff. While a replica is down, the coordinator sends its copy to another healthy node together with a hint naming the intended replica. That node stores hints separately and delivers them when the replica returns, then deletes them. It is fast and cheap, but best-effort: hints are kept for a limited window (Cassandra's max_hint_window defaults to three hours), and they are lost if the node holding them fails.
Read repair. A read asks several replicas and compares versions. The coordinator returns the newest value and writes it back to any replica that answered with an older one. It costs almost nothing extra, but only repairs keys that are read; rarely read keys can stay stale indefinitely.
Anti-entropy with Merkle trees. A background process compares replicas pairwise. Each replica builds a Merkle tree over its key ranges: leaves hash the data in a small range, every parent hashes its children. Two replicas exchange root hashes; if they match, the whole range is identical. If not, they compare children and descend only into ranges that differ, so a handful of round trips locate the few keys that need copying. In Cassandra this is nodetool repair (or managed repair tooling), run regularly so replicas converge within a bounded time.
Concurrent writes. No leader orders writes. Two clients can write the same key at the same time through different coordinators, and both writes can reach a quorum. Version vectors (or dotted version vectors, as in Riak) record which versions each write was based on, which distinguishes "newer" from "concurrent". For concurrent writes the store either keeps both as siblings for the application to merge on the next read (Riak), or keeps the one with the highest timestamp (last write wins, Cassandra's per-column rule) and silently drops the other. CRDT data types merge automatically.
When to use it
- High write availability matters more than strict ordering: carts, sessions, user activity, IoT telemetry, messaging inboxes.
- Large, write-heavy datasets spread across many nodes, where per-node failure is constant and routine.
- Multi-data-centre deployments with local quorums per data centre and asynchronous replication between them.
When not to
- Operations that need one winner: uniqueness, compare-and-set, counters with limits, financial ledgers. Use a leader or consensus (Cassandra's lightweight transactions use Paxos for this, at a latency cost).
- Workloads built on multi-row transactions and joins, which leaderless stores generally don't provide.
- Teams that can't run repair. Without regular anti-entropy, replicas drift and deleted data can reappear.
Trade-offs
| Mechanism | Fixes | Misses | Cost |
|---|---|---|---|
| Hinted handoff | Writes during short outages | Outages longer than the hint window; hints on a node that also fails | Hint storage on other nodes |
| Read repair | Stale replicas a read touches | Keys that are never or rarely read | A little extra work on reads |
| Anti-entropy (Merkle trees) | Every difference, eventually | Nothing, if run often enough | Background CPU, disk and network; must be scheduled |
| Siblings + merge | Concurrent writes without loss | — | Every reader handles conflicts |
| Last write wins | Concurrent writes, simply | All but one concurrent write; clock skew picks | Silent data loss |
Alternatives
- Single-leader replication: a single order of writes and simple reads, with failover as the price.
- Multi-leader replication: a leader per region; similar conflict handling, fewer nodes accept writes.
- Consensus-replicated stores (etcd, CockroachDB, Spanner): majorities with a leader and a log, giving linearizable operations.
Failure modes
- Silent data loss under LWW for concurrent writes, and when a node's clock runs ahead.
- Resurrected deletes. A delete is stored as a tombstone; if a replica misses it and tombstones are purged before repair reaches that replica, the old value comes back. Cassandra's
gc_grace_seconds(10 days by default) exists so that repair runs before tombstones are dropped. - Hint backlogs after long outages, which then flood the returning node.
- Repair storms: an overdue full repair saturating disks and network.
- Stale reads when W + R ≤ N, or with sloppy quorums, until the catch-up mechanisms finish.
In production
Cassandra and ScyllaDB clusters run with replication factor 3 per data centre and LOCAL_QUORUM for most reads and writes. Operators watch hint queues, schedule incremental or full repairs well inside gc_grace_seconds, and treat a node that was down longer than the hint window as needing repair before it serves reads. Data models avoid read-modify-write on the same key from several clients, or use CRDT-style types (counters, sets) where available.
Common misconceptions
- "No leader means no consistency." Consistency is tunable per request through W and R; with W + R > N reads overlap the latest acknowledged write.
- "Hinted handoff makes failures invisible." Hints are temporary and best-effort; repair is still required.
- "Read repair keeps all data fresh." Only the data that is read.
- "Replicas converge on their own." They converge because handoff, read repair and anti-entropy run; turn them off and they drift.
Interview angle
Choose leaderless storage when the design needs writes that survive node failures without failover, and say how it converges: "RF 3, LOCAL_QUORUM; a failed node is caught up by hinted handoff for short outages and scheduled repair for long ones; reads repair what they see." Then address concurrent writes (version vectors and merges, or LWW and its losses) and name what needs a different tool (uniqueness: lightweight transactions or a separate strongly consistent store).
Model assumptions
This lesson is a scripted illustration, not a simulation: the queueing engine has no leaderless mode (no client fan-out to several databases, no versions, hints or Merkle trees), so every write, acknowledgement, hint, repair and hash exchange is a scripted packet, and replica contents are shown as annotations. One-way times are illustrative: 10 ms between the coordinator and each replica, 12 ms to Node D and between replicas, and 1 ms for a replica to answer. Real intra-data-centre hops are usually well under a millisecond; the larger numbers make the order of events visible. There is no sandbox for this lesson for the same reason.