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 read replica. Within a second, both of them have faithfully deleted every order too.
Play this levelPart of Bugpit Pro. It runs in your browser: build the design, press Run, and watch what breaks.
The lesson
Replicas and standbys protect you from a machine dying. They don't protect you from a mistake, because they copy every change, including the wrong ones.
A backup is a copy from an earlier time, kept apart. With point in time recovery the database also keeps its log of changes, so you can rebuild it as it was at 1:59 p.m. Click **Primary DB** and tick **Backups**.
Two numbers describe a recovery plan. RPO, the recovery point objective, is how much recent data you can afford to lose. With nightly backups that's up to a day. With point in time recovery it's minutes. RTO, the recovery time objective, is how long you can be down while you restore.
A backup you've never restored is a hope, not a plan. Restore one on a schedule and time it. Keep a copy somewhere else too, in another region or account, so whatever destroys the database can't reach the backup.
This simulator can't lose data, so it only checks that backups are on. The questions cover the rest.
What you have to achieve
3,000 requests a second at the busiest hour, 5% of them writes.
- No broken or illegal connections
- A mistaken delete can be undone
- No component is overloaded
- Fewer than 0.1% of requests fail
- p99 response time under 250 ms
What you learn
The orders can be brought back as they were at 1:59 p.m. Restoring a large database can take hours, and that time is your RTO. Decide what the business can live with before the bad day, not during it.
Check yourself
Why didn't the replica save the orders?
- It was too slow
- It copies every change, including the delete
- It ran out of disk
Show the answer
It copies every change, including the delete. A replica's job is to match the primary. It can't tell a mistake from a real change.
You take one backup a night, at midnight. The database is destroyed at 6 p.m. How much data can you lose?
- None
- Up to 18 hours
- Up to a week
Show the answer
Up to 18 hours. Everything since the last backup is gone. That gap is your RPO.
What does RTO measure?
- How much data you can lose
- How long you can be down while you recover
- How many backups you keep
Show the answer
How long you can be down while you recover. RTO is about time to recover. RPO is about data lost. A plan needs both.
How do you know your backups work?
- The backup job says it succeeded
- You restore one regularly and check the data
- You keep three copies
Show the answer
You restore one regularly and check the data. Only a restore proves it. Teams have found on the worst day that their backups were empty or unreadable.