System Design
5. Advanced Database ArchitectureAnimated
Database Failover
Switching to a standby when the primary fails.
The idea
A monitor detects the failure and promotes a replica, redirecting clients.
Watch it work
Press play, pause, or step through. Some animations have settings you can change.
- current message
- earlier
- failure or attack
Normally all writes go to the primary.
- step:
- 1/6
- from:
- App
- to:
- Primary
1/6
Time runs downward. Solid arrows are requests, dashed arrows are replies.
Step by step
- 1Detect primary failure
- 2Choose the most up-to-date replica
- 3Promote it
- 4Redirect clients
Where it is used
High availability.
Watch out for
Split brain and lost writes if not fenced.