Skip to content
tezvyn:
Menu

Leaderless Replication: No Master, No Bottleneck

MediumHow cards are made

Leaderless replication lets any node accept writes, skipping a single leader bottleneck. Systems like Dynamo stay available during partitions, reconciling conflicts with vector clocks later.

Why it exists

Leader-follower replication forces all writes through a single leader, which creates a bottleneck and a single point of failure. If that leader crashes or is partitioned by a network split, applications must either stop writing or execute a complex failover. Leaderless replication was invented to eliminate that central chokepoint by allowing every node to accept writes directly, keeping the database available for writes even when individual replicas are unreachable.

The mental model

Imagine a team of editors working on a document without a chief editor. Everyone can write changes at any time, and the group reconciles differences later by comparing versions. In the same way, leaderless replication treats all replicas as peers. There is no master dictating order; instead, the system tolerates temporary disagreement and trusts that reads or background processes will eventually converge on the correct state.

How it works

A client sends a write to all N replicas in the cluster, or to a coordinator node that forwards the request. The operation succeeds once W replicas acknowledge it. On read, the client queries R replicas and compares version vectors or timestamps to find the most recent value. If R plus W is greater than N, the read and write quorums overlap, so at least one node should have the latest data. When a replica misses a write because it was offline, the system may use hinted handoff to replay missed updates or run anti-entropy repairs with Merkle trees to synchronize divergent data. If concurrent writes produce conflicting versions, the database either applies a conflict resolution rule such as last-write-wins or returns all versions to the application to merge.

When to use it

Use leaderless replication when write availability is more important than immediate strong consistency. It fits wide-area deployments, shopping carts, sensor ingestion, and any workload where a single leader would be a geographic bottleneck or a failure risk. It also helps when you need to survive arbitrary node failures without failover drama.

When not to use it

Do not use it when your application requires linearizable consistency, ACID transactions across keys, or foreign-key constraints. Because writes may diverge and reconciliation happens after the fact, leaderless systems push complexity to the application. If your code cannot merge conflicting versions, last-write-wins may silently discard updates and corrupt business logic.

One canonical example

Amazon Dynamo pioneered this approach for the shopping cart service. A customer could add an item to their cart even if the closest data center was unreachable, because any replica could accept the write. The system stored conflicting versions using vector clocks and performed read repair and background Merkle tree synchronization to converge replicas. This traded strict consistency for the guarantee that customers would never be blocked from adding items.

Interview question

An e-commerce service must accept shopping-cart writes while a network partition isolates some replicas. What does leaderless replication provide, and what trade-off should the team expect?

  • a.A standby leader is promoted automatically during the partition, preserving ACID guarantees without application changes
  • b.Any reachable replica can accept writes during the partition, but the application may later have to merge conflicting versionsCorrect
  • c.Every replica must acknowledge each write before it succeeds, ensuring immediate strong consistency across the cluster
  • d.Vector clocks assign a global order to all writes, preventing conflicts entirely so no reconciliation is ever needed
Why?

Leaderless replication keeps writes available by letting any replica accept them, but because concurrent writes may diverge during a partition, the application must sometimes reconcile conflicting versions. Option A incorrectly describes leader-follower failover, which still requires an election and does not eliminate the central bottleneck.

Just read this? Test yourself on what you have been reading.

Put your scrolling time to good use

Learn one idea, try a quiz and save useful cards for revision. Tezvyn makes it easy to learn and stay current in your tech field, a few minutes at a time.

The iPhone app is on the way

We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.

Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.

Get it on Google PlayiPhone app coming soon

We are hiring for this. Every open role lists the topics its interview covers, so you can prepare for the real thing rather than guessing.

See open roles