Skip to content
StackDecode
System Design
5. Advanced Database ArchitectureAnimated

Multi-Master Replication

Several nodes accept writes.

The idea

Each master replicates changes to the others. This improves write availability and locality but needs conflict resolution.

Watch it work

Press play, pause, or step through. Some animations have settings you can change.

ClientsLoad balancerNode A (live)Node B (live)
  • client
  • gateway / proxy
  • service
  • cache
  • data store
  • queue / stream

Both nodes serve traffic at all times.

step:
1/4
at:
Clients
1/11

The green dot is a request moving through the system.

Step by step

  1. 1Clients write to any master
  2. 2Each master forwards the change
  3. 3Others apply it
  4. 4Conflicts are resolved by a rule

Where it is used

Multi-region writes.

Watch out for

Conflicts: last-write-wins can silently lose data.

Related