Skip to content
StackDecode
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.

App serversPrimary (writes)Replica 1 (read…Replica 2 (read…
  • 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

  1. 1Clients write to the leader
  2. 2It logs the change
  3. 3Followers apply
  4. 4Followers serve reads

Where it is used

Most databases.

Watch out for

Leader is a write bottleneck.

Related