Backups, disaster recovery, RPO and RTO
Decide how much data you can lose (RPO) and how long you can be down (RTO), pick a DR strategy that meets both, and prove it with a timed restore drill.
Regions, availability zones and failure domainsCompute, storage and networking building blocksSecrets management for infrastructure
Backups, disaster recovery, RPO and RTO
The player loads from youtube-nocookie.com when you press play. Nothing reaches YouTube before that.
Not started
What you'll learn
- RPO, the recovery point objective, is how much recent data you can afford to lose, measured in time. RTO, the recovery time objective, is how long you can afford to be down.
- Your real RPO is the gap between backups, or the replication lag, plus anything not covered. Your real RTO is detection, decision and restore time added together. Only a drill measures them.
- Replication is not a backup. A deleted table or ransomware is replicated to every copy within seconds, so keep point-in-time backups that a bad change cannot reach.
- DR strategies trade cost for speed: backup and restore, pilot light, warm standby and multi-site active-active, from cheapest and slowest to most expensive and fastest.
- Follow 3-2-1: three copies, on two kinds of storage, one off-site. In the cloud, off-site means another region and another account, with deletion locked.
The problem: a backup nobody has restored
Every team says it has backups. Fewer have restored one recently. A backup job can report success for months while writing an empty file, missing a new database, or saving a copy that is corrupted because it was taken mid-write. You find out on the worst day, when you need it.
The full-stack roadmap covers backups and restores for one app’s database. This lesson is the operator’s view across a system: setting recovery targets, choosing a strategy that meets them, and proving it works.
Two numbers to agree first
Before choosing tools, agree two numbers with the business for each system:
- RPO (recovery point objective): how much recent data you can lose, measured in time. An RPO of 1 hour means losing the last hour of orders is acceptable, and two hours is not.
- RTO (recovery time objective): how long the system can be down before it is restored.
Think of a writer saving a manuscript. RPO is how often they press save. RTO is how long it takes to find the file and get back to work after the laptop dies.
Tighter numbers cost more. “Zero data loss and zero downtime” is a design for multi-region active-active with synchronous writes, and the bill to match. Most systems need different numbers for different data: orders might need an RPO of minutes, while an analytics cache can be rebuilt from scratch.
Strategies, cheapest first
The usual ladder, named the same way across AWS, Azure and Google Cloud guidance:
- Backup and restore: back up to another region. In a disaster, rebuild the infrastructure from code and restore the data. Cheapest. RTO in hours.
- Pilot light: data replicated continuously to the recovery region, with compute off or minimal. Start and scale it when needed. RTO in tens of minutes.
- Warm standby: a scaled-down but running copy in the recovery region. Scale up and switch traffic. RTO in minutes.
- Multi-site active-active: both regions serve traffic all the time. RTO near zero, highest cost and complexity. System design’s availability patterns covers the failover mechanics.
Whatever the strategy, two rules hold.
Replication is not a backup. A replica copies every change, including DROP TABLE and ransomware encryption, within seconds. You also need point-in-time backups that later changes can’t alter.
3-2-1: three copies of the data, on two kinds of storage, one off-site. In the cloud, “off-site” should mean another region and another account. If someone, or something, gets admin rights in production, they shouldn’t be able to delete the backups too. Object lock on S3, immutable vaults in Azure Backup, and bucket retention locks in Google Cloud Storage enforce that. Backups also hold secrets and personal data, so encrypt them, with the keys managed as in the secrets lesson.
A worked example: a timed restore drill
Your real RPO and RTO are whatever a drill measures, not what the plan says. I ran a small drill in Python with SQLite standing in for the production database. A writer thread inserts an order every 50 ms. Every 3 seconds the script takes a consistent online backup with SQLite’s backup API, compresses it with tar and gzip, and stores a SHA-256 checksum next to it. After about 10 seconds it deletes the live database. Then it restores the newest backup, verifies the checksum, runs SQLite’s integrity check, and measures what was lost:
$ python3 drill.py
t= 3.0s backup 1 written, sha256 132803076e40
t= 6.0s backup 2 written, sha256 7dbda35c2c92
t= 9.0s backup 3 written, sha256 9ac9e90d6d22
t=10.2s DISASTER: live database gone (172 orders existed)
restored orders-3.db.tgz: checksum ok, integrity_check ok, 154 orders
data lost: 18 orders, the last 1.0s of writes (actual RPO)
restore took 3 ms (actual RTO, excluding detection and decision time)
Scale the numbers up and the lessons hold:
- Lost data equals time since the last backup. With a 3-second schedule the worst case is 3 seconds. With nightly backups it is 24 hours. To go below the backup interval you need continuous log shipping: point-in-time recovery, which every managed database offers.
- Verify before you trust. The checksum shows the file wasn’t damaged in storage. The integrity check shows the database inside is usable. A restore that skips both can bring back garbage.
- The restore is the smallest part of RTO. Mine took 3 ms for a tiny file. A real multi-terabyte restore takes hours, and before it starts someone has to notice, get paged, decide to restore rather than repair, and find the runbook. Time all of it.
- Copy consistently. I used SQLite’s backup API, not a plain file copy, because copying a database file mid-write can capture a half-written page. Real databases have the same rule: use their snapshot or dump tools.
Run a drill like this on a schedule, against production-sized data, into an isolated environment, and record the measured RPO and RTO next to the targets.
About the video
“The Ultimate Guide to Disaster Recovery: RTO, RPO, & Failover!” is from ByteMonk, published March 2025, 10 minutes 52 seconds. Its chapters cover RTO versus RPO, failover versus fallback, the DR strategies (backup and restore, pilot light, warm standby and hot standby), cloud-based DR on AWS, Azure and Google Cloud, and chaos testing to prove the plan works. That is this lesson’s structure, though it doesn’t cover backup verification or 3-2-1. English is judged from the title, description and channel. IBM’s lightboard video separates backup from disaster recovery, and the AWS re:Invent session goes deep on AWS’s own DR services.
Where this fits
Everything so far is something each team has to get right. The last lesson is about making the right way the easy way for all of them: internal developer platforms and golden paths.
Check yourself
Backups run every 6 hours and a restore takes 2 hours. What are the worst-case RPO and the best-case RTO?
The worst-case RPO is 6 hours of lost writes, if the failure comes just before the next backup. The RTO is at least 2 hours plus however long it takes to notice and decide to restore.
Why doesn't a synchronous database replica in another zone count as a backup?
It copies every change, including mistakes. A dropped table or encrypted data is on the replica moments later. A backup is a point-in-time copy that later changes don't alter.
What is a pilot light DR setup?
Data is continuously replicated to the recovery region, but compute there is off or minimal. In a disaster you start and scale the compute, which is cheaper than a warm standby but slower to recover.
Why put backups in a separate account with deletion locked?
If an attacker or a faulty script gets admin access to the production account, they can delete the backups too. A separate account with object lock or immutable vaults keeps a copy out of reach.
Go deeper
Notes
Notes are saved to your account.
Everything else on this page works without one — progress and bookmarks keep themselves in this browser and come with you when you sign in. Notes are the one thing worth not trusting to a browser you might clear.
Your notes could not be loaded.