Sub topic 3
Backup and restore: the lowest-cost strategy
Backup and restore is the simplest disaster recovery (DR) strategy on AWS. You take regular backups, store copies outside the failure scope, and rebuild the workload from those copies after a disaster. Nothing runs in the recovery Region until you need it. This chapter explains the working model, what limits recovery time, and the errors that most often cause a restore to fail.
This chapter assumes you know Regions, Availability Zones, EC2, S3, and managed databases such as RDS. It also assumes you can read JSON and AWS CLI commands. It relies on the terms RTO (recovery time objective, how long you can be down) and RPO (recovery point objective, how much data you can lose, measured in time).
The working model
In this strategy the recovery Region holds only data: backups, snapshots, and machine images. It holds no running compute and no running database. When a disaster happens, you do three things:
- Declare the disaster and decide to recover.
- Create the infrastructure in the recovery Region.
- Restore data into that infrastructure, then redirect users.
Because step 2 and step 3 happen after the disaster, recovery time includes provisioning, restoring, validating, and switching traffic. For most workloads this is hours. The strategy is therefore a fit for RTOs and RPOs measured in hours, and it is usually a poor fit for anything tighter.
What determines your RPO
RPO is set by how recent the newest usable backup in the recovery Region is. That is not the same as how often you take backups. Consider a daily backup that runs at 05:00 and takes 40 minutes to copy to the second Region. A disaster at 04:59 leaves you with the backup from the previous day's 05:00 run, which is nearly 24 hours old. If the copy to the second Region is still running, the newest usable point is older still.
Your effective RPO is therefore roughly the backup interval plus the copy delay. Three levers improve it:
- Increase backup frequency. Hourly snapshots cut the interval, at the price of more storage and more copy traffic.
- Use continuous backup where the service supports it. For example, point-in-time recovery (PITR) for DynamoDB and S3 lets you restore to a moment within a retention window, which gives an RPO in the seconds-to-minutes range. Check whether the continuous history is available in the recovery Region, because PITR data is often tied to the source Region.
- Add replication for the data that matters most. That moves you toward the strategies in later chapters.
What determines your RTO
RTO is the sum of several steps, and the slowest one usually surprises people:
| Step | What takes the time | Typical mitigation |
|---|---|---|
| Detection and decision | Confirming the disaster is real and getting approval | Written criteria and a named decision-maker |
| Provisioning | Creating networks, load balancers, compute, and databases | Infrastructure as code, tested regularly |
| Data restore | Copying snapshot data into new volumes or clusters | Smaller datasets, restore tests that measure real duration |
| Application setup | Configuration, secrets, certificates, integrations | Keep these in the recovery Region ahead of time |
| Validation | Checking that the restored system works | Automated smoke tests |
| Traffic switch | DNS propagation and cache expiry | Low TTL on records |
Restore time depends on data size and on the service. An RDS restore from a snapshot creates a new instance and must load the data, so a multi-terabyte database takes much longer than a small one. Some restores also start fast but run slowly at first, because blocks are loaded from S3 on first access. A restore that "completes" is not always at full performance. Measure it.
What to back up
Data is the obvious part. A complete list for a recovery also includes the items that people forget:
- Databases: RDS and Aurora snapshots, DynamoDB backups, and any self-managed databases on EBS.
- Block and file storage: EBS snapshots, EFS and FSx backups.
- Object storage: S3 objects, through versioning plus replication or AWS Backup.
- Machine images: copy AMIs to the recovery Region, because an AMI ID is Region-specific.
- Configuration and secrets: Systems Manager parameters, Secrets Manager secrets, and certificates in ACM. These do not travel between Regions on their own.
- Infrastructure definitions: CloudFormation or Terraform code, stored in a repository that is reachable when the primary Region is down.
Copying backups out of the failure scope
A backup in the same Region and account as the workload protects you against deleted data and bad deployments. It does not protect you against a Region failure, and it does not protect you against an attacker or an error that removes the account's resources. A DR copy should be in another Region. For stronger protection against deletion or ransomware, also use a separate account and a locked vault.
AWS Backup handles this with a backup plan. The following plan takes a daily backup and copies each recovery point to a vault in us-west-2. You apply it with aws backup create-backup-plan --backup-plan file://plan.json.
{
"BackupPlanName": "dr-daily",
"Rules": [
{
"RuleName": "daily-with-cross-region-copy",
"TargetBackupVaultName": "Default",
"ScheduleExpression": "cron(0 5 * * ? *)",
"Lifecycle": { "DeleteAfterDays": 35 },
"CopyActions": [
{
"DestinationBackupVaultArn": "arn:aws:backup:us-west-2:111122223333:backup-vault:dr-vault",
"Lifecycle": { "DeleteAfterDays": 35 }
}
]
}
]
}A few details are worth knowing:
- The destination vault must already exist in the destination Region before the plan runs.
- The plan only defines the schedule. You must also assign resources to it with a backup selection, by resource ID or by tag. A plan with no selection backs up nothing.
- The copy is a second job that starts after the first backup completes. Monitor both jobs, not just the first.
- Retention is set separately for the source and the copy.
Restoring: an example sequence
During a recovery, you restore from the copy in the recovery Region. For a database, the sequence is typically to find the newest recovery point, start a restore job, and wait for it to finish. The commands below list recovery points in the DR vault.
aws backup list-recovery-points-by-backup-vault \
--region us-west-2 \
--backup-vault-name dr-vault \
--query 'sort_by(RecoveryPoints, &CreationDate)[-5:].[RecoveryPointArn, ResourceType, CreationDate, Status]' \
--output tableThe Status column should read COMPLETED. A recovery point that is still PARTIAL or EXPIRED cannot be used. Restoring then uses aws backup start-restore-job with metadata that depends on the resource type, which is why you should rehearse the exact call ahead of time and keep it in your runbook.
Common errors
- Backups exist but have never been restored. An untested backup is an assumption. Restore regularly and record how long it takes. That measurement is your real RTO.
- Dependencies missing in the recovery Region. VPCs, subnets, security groups, IAM roles, KMS keys, and AMIs must exist or be created by your code.
- Service quotas. Quotas apply per Region. A new Region might not allow the number of instances or the instance types your production stack needs, so request increases ahead of time.
- Capacity. Launching a large fleet during a regional event can compete with many other customers. Backup and restore has no reserved capacity, so consider capacity reservations if the RTO is firm.
- Hard-coded Region names, endpoints, or ARNs. Parameterize them in your templates.
- Backups in the same failure scope. Check that the copy really sits in another Region, and ideally another account.
- Retention shorter than detection time. If corruption is found after 40 days and you keep 35, no clean copy remains.
Cost profile
This is the cheapest strategy because you pay mainly for storage and transfer, not for idle compute. The cost lines are backup storage in both Regions, cross-Region data transfer for each copy, and the occasional cost of restore tests. Retention drives most of the spend, so match it to the business need. Incremental snapshots keep storage growth below the full data size, though the first copy of a dataset is full-sized.
Exercise
A workload takes an AWS Backup recovery point daily at 05:00. The copy to the DR Region finishes about 45 minutes later. The team says the RPO is "one day." Give a more accurate worst-case RPO, and name one change that would shorten it without adding running compute in the DR Region.
Show answer
The worst case is just before the next copy completes. A disaster at about 05:44 the next day finds the previous day's copy as the newest usable point, which is nearly 24 hours and 45 minutes old, so the RPO is about one day plus the copy delay (a little over 24.5 hours). To shorten it, take backups more often (for example hourly) or use continuous backup or point-in-time recovery for services that support it, after confirming the history is usable in the DR Region.
Exercise
A restore in the DR Region fails with an access error on a snapshot that was copied successfully. What is the most likely cause, and where do you look?
Show answer
The most likely cause is that the snapshot was encrypted with a KMS key from the primary Region, or that the restoring role lacks permission on the destination Region's key. Check which KMS key encrypts the recovery point in the DR vault, confirm the key exists in the DR Region, and confirm the IAM role used for the restore is allowed to use it.