System Design
18. Advanced Distributed ArchitectureAnimated
Leader-Follower Replication
One node accepts writes; followers copy.
The idea
The leader orders writes and followers apply them in order.
Watch it work
Press play, pause, or step through. Some animations have settings you can change.
- client
- gateway / proxy
- service
- cache
- data store
- queue / stream
Step one: add indexes and cache.
- step:
- 1/4
- at:
- App servers
1/7
The green dot is a request moving through the system.
Step by step
- 1Clients write to the leader
- 2It logs the change
- 3Followers apply
- 4Followers serve reads
Where it is used
Most databases.
Watch out for
Leader is a write bottleneck.