Module 5 6 lessons 79 min
When one database isn't enough
With the cache and ten servers in place, the database is the next thing to break at dinner. Copy it and send reads to the copies - then a customer places an order and the order page says it doesn't exist, and one night the primary's disk fails.
Client
your system
Everything between the request and the response.
one machine
Reverse proxy
API server
Database
Payment provider
LB
Server 1
Server 2
Server 3
Redis cache
Database
Read replica
Object storage
In this module
5 Read · 1 Lab
- 5.1Read replicasOur load test's next limit is the database. Keep writes on one primary, copy it, and send reads to the copies.Read12 min
- 5.2Replication lagCopies fall behind the primary. Why a customer can't find the order they just placed, and how to read your own writes.Read12 min
- 5.3When the primary diesPromote a replica: automatic or manual, the writes you can lose, and what “three nines” really allows.Read12 min
- 5.4Backups and recoveryA replica copies your mistakes too. Backups, point-in-time restore, and testing that a restore works.Read10 min
- 5.5Proof: one primary, two replicasThe load test that maxed out one database, run again with two replicas. Then we kill the primary and time the failover.Read8 min
- 5.6Lab: Add read replicas to the clinicThe database is the bottleneck. Add replicas, handle replication lag, and plan failover and backups.Lab25 min