STORAGE, CACHING & SEARCH · SUBTOPIC
Leader-Follower, Multi-Leader & Leaderless Replication
Compare single-leader, multi-leader, and Dynamo-style leaderless replication.
IntermediatePart of Replication & Partitioning (Sharding)
Subtopics in Replication & Partitioning (Sharding) (2)
In plain words
Single-leader means one boss takes all edits and tells assistants. Multi-leader means one boss per continent syncing later. Leaderless means you write to several nodes at once and vote on the latest copy.
Think of it like…
One master recipe book copied to branch kitchens (Single-Leader) vs. local branches editing menus independently and syncing nightly (Multi-Leader).
Loading interactive diagram
Loading interactive exercise
Theory & how it works
Sync vs. Async Replication
Synchronous waits until a replica confirms the write before returning OK to the user - zero data loss on failover, but higher write latency and stalls if the replica is slow. Asynchronous returns OK immediately - fast writes, but a sudden primary crash may lose the last few milliseconds of writes.
Key points & practical guide
Summary checklist
- Single-leader is the clean default for most apps
- Use sync replication (or semi-sync) for critical financial data
- Multi-leader introduces write conflicts that need CRDTs or LWW
When to use it
- Adding read scale and HA before sharding
Watch out for
- Reading from an async replica right after writing can show stale data ("read-your-own-writes" bug)
Quick check
Loading quiz