Skip to content
StackDecode
System Design
5. Advanced Database ArchitectureAnimated

Asynchronous Replication

The primary confirms immediately and replicates later.

The idea

Writes are fast, but if the primary fails before shipping, recent writes can be lost.

Watch it work

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

ProducerBrokerConsumerpublish job
  • current message
  • earlier
  • failure or attack

A producer sends a message.

step:
1/6
from:
Producer
to:
Broker
1/6

Time runs downward. Solid arrows are requests, dashed arrows are replies.

Step by step

  1. 1Client writes
  2. 2Primary acknowledges at once
  3. 3Changes ship in the background
  4. 4Replicas catch up

Where it is used

Most read-scaling setups.

Watch out for

Data loss window and stale reads.

Related