Primary database
The one database copy that accepts writes. It is the source of truth.
See it in action
These lessons put primary database to work. Read one, then play it and watch what happens without it.
- Scale out: You hit the news. 6,000 req/s arrive and one app server handles about 2,000. Press Run traffic to watch it fall over.
- Survive a crash: Launch day: 10,500 requests per second. Machines die all the time. Any single one may crash, and once failover ends,…
- One shard on fire: Dinner rush at a food delivery app: 25,000 req/s, and 40% are new orders. Orders are already split across 4 of the…
- Go worldwide: Half your users are now outside the US: 30% in Europe and 20% in Asia. A read from Mumbai to Virginia takes about 190…
- Fresh or fast: People change their shipping address, reload the page and see the old one. Your replicas are a moment behind the…
- Undo a mistake: At 2 p.m. an engineer runs a delete without its filter, and every order is gone. Your database has a standby and a…
- Three copies, no leader: A shopping cart is kept on 3 machines, and none of them is in charge: any of them takes a write. Right now a write…
- Two primaries: Your database has two machines: a primary and a standby. The network between them drops for a minute. The standby…