- rtshkmr's digital garden/
- References/
- Architecture Design Basics/
- Pattern Taxonomy/
- Scaling & Performance/
- Leaderless Replication/
Leaderless Replication
··
176 words·
1 min
Table of Contents
🟠P1 — Dynamo-style replication; no single leader, quorum-based
Problem #
Leader-based replication has a single point of write failure (the leader). Leaderless eliminates this by allowing any replica to accept writes.
Mechanism #
- Client writes to multiple replicas simultaneously (or via a coordinator)
- Reads also query multiple replicas and resolve conflicts
- Consistency via quorum: write to W nodes, read from R nodes, where W + R > N (total replicas)
N=3 replicas, W=2, R=2
Write: client sends to all 3, succeeds when 2 acknowledge
Read: client reads from 2, takes the most recent value
W + R = 4 > N = 3 → guaranteed overlap → read sees latest writeKey Trade-offs #
- Availability: No leader = no leader failover. Any node can serve reads and writes.
- Conflict resolution: Concurrent writes to different replicas create conflicts. Need a resolution strategy (last-write-wins, vector clocks, CRDTs).
- Complexity: Significantly more complex than leader-follower. Conflict resolution is the hard part.
Instinct #
Leaderless is for systems that prioritise availability over consistency (AP in CAP terms). DynamoDB, Cassandra, Riak use this model. For most applications, leader-follower is simpler and sufficient. Leaderless shines in multi-datacenter deployments where you can’t afford cross-region writes to a single leader. See also: Quorum Reads & Writes.
DDIA 2e Reference #
- Chapter 5: Leaderless Replication, quorums, conflict resolution