Skip to content
StackDecode
System Design
5. Advanced Database ArchitectureAnimated

Database Replication

Copying data to other servers.

The idea

Replication keeps copies for availability and read scaling. The copies follow the primary by shipping changes.

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. 1Primary accepts a write
  2. 2It logs the change
  3. 3Replicas receive and apply it
  4. 4Reads can be served by replicas

Where it is used

High availability and read scaling.

Watch out for

Replicas can lag behind the primary.

Related