Overview and What You Will Learn
AWS disaster recovery strategies are four patterns that trade cost for recovery speed: Backup and Restore, Pilot Light, Warm Standby, and Multi-Site active-active. You choose one by working backwards from two numbers the business must agree to, the Recovery Point Objective (RPO) and the Recovery Time Objective (RTO).
In this guide you will learn:
- What counts as a disaster, which is more than fires and floods
- How RPO and RTO define your strategy and your budget
- How each of the four strategies works, what runs during normal operation, and what it costs
- How AWS Elastic Disaster Recovery replicates servers into a low-cost staging area
- How AWS Backup, cross-Region copies, and Vault Lock protect backups from deletion and ransomware
- How DMS, Aurora migration paths, and large transfers fit into a recovery plan
- How to run a restore test and a failover drill instead of trusting the design
Why This Matters in Production
When a production database is dropped at 2 AM or ransomware encrypts a data center, the difference between five minutes and five days of downtime is whether you built the recovery path before the incident. A payments platform like Razorpay cannot wait hours to rebuild, so it needs Warm Standby or better. Regulated teams also answer to auditors who ask for tested recovery times. RPO and RTO are promises to the business, and every architecture choice is a cost versus recovery speed trade-off.
Core Principles
What Counts as a Disaster in AWS
A disaster is any event that threatens business continuity or finances. Most real incidents are not natural disasters.
- A developer deletes a production table or drops a database
- A misconfigured security group exposes a database to the internet
- A bad deployment corrupts data or takes the application down
- Ransomware encrypts on-premises systems or deletes backups
- A compromised account destroys resources
- A Region-level outage takes a whole stack offline
What Are RPO and RTO
RPO is how much data you can afford to lose, measured in time. RTO is how long you can afford to be down. Both must be agreed in writing with the business before you design anything.
2:00 PM last backup completes7:00 PM disaster hits7:05 PM restore from the 2:00 PM backup begins10:00 PM service is live again Data lost: 5 hours of changes -> actual RPO = 5 hoursDowntime: 3 hours -> actual RTO = 3 hoursLower RPO needs more frequent or continuous replication. Lower RTO needs more resources already running in the recovery site. Both cost money, so state them as numbers, such as "RPO 15 minutes, RTO 1 hour".
The Four AWS DR Strategies
Each strategy keeps more of your stack ready in the recovery site, which shortens recovery and raises cost.
Rebuild from backups] D --> PL[Pilot Light
Start the app tier] D --> WS[Warm Standby
Scale up small stack] D --> MS[Multi-Site
Shift traffic] BR -->|Hours| R([Recovered]) PL -->|Tens of minutes| R WS -->|Minutes| R MS -->|Seconds| R classDef start fill:#EF4444,color:#ffffff classDef cheap fill:#DBEAFE,color:#1E293B classDef mid fill:#326CE5,color:#ffffff classDef costly fill:#8B5CF6,color:#ffffff classDef done fill:#10B981,color:#ffffff class D start class BR cheap class PL,WS mid class MS costly class R done
| Strategy | Typical RPO and RTO | Runs normally in recovery site |
|---|---|---|
| Backup and Restore | Hours | Nothing, only stored backups |
| Pilot Light | Minutes to hours | Replicated data, app tier stopped |
| Warm Standby | Minutes | Full stack at minimum size |
| Multi-Site active-active | Seconds to minutes | Full stack at production scale |
These values are typical, not guarantees. Measure your own with drills.
Backup and Restore is the cheapest and slowest strategy. Data is copied to S3 or backup vaults on a schedule, and infrastructure is rebuilt from AMIs and infrastructure as code after a disaster. Your RPO equals the time since the last backup, so a daily schedule means up to 24 hours of lost data.
Pilot Light keeps the hardest part to restore, the data, continuously replicated and ready in the recovery site, while the application servers stay off. During a disaster you start the app tier from prepared AMIs, promote the database replica, and switch DNS. Databases are slow to recover and app servers are fast to start, which is why the split works.
Warm Standby runs a complete but scaled-down copy of the stack in the recovery site. On failure you scale up instead of starting from nothing, and you can serve some traffic immediately. The difference from Pilot Light is that application servers are already running at minimum size.
Multi-Site active-active runs full production in two places at once, and Route 53 sends real traffic to both. If one site fails, the other absorbs the traffic with no scale-up. Within AWS you build this across two Regions, commonly with Aurora Global Database (typically under a second of replication lag) or DynamoDB global tables for the data layer.
RememberThe strategies differ in what is already running. Backup and Restore has nothing, Pilot Light has data, Warm Standby has a small working stack, and Multi-Site has a full one. Recovery time shrinks as more is running.
How AWS Elastic Disaster Recovery Works
AWS Elastic Disaster Recovery (DRS) continuously replicates physical, virtual, and cloud servers into AWS at the block level so you can recover them in minutes. It was previously known as CloudEndure Disaster Recovery. It avoids paying for full-size servers while you wait by splitting the target into two areas.
on-premises or other Region] -->|Block replication| ST[(Staging area
low-cost EC2 and EBS)] ST -->|Launch on failover| REC[Recovery instances
full-size EC2] REC --> R53([Route 53 shifts traffic]) REC -.->|Failback| SRC classDef src fill:#475569,color:#ffffff classDef stage fill:#F97316,color:#ffffff classDef rec fill:#10B981,color:#ffffff classDef dns fill:#DBEAFE,color:#1E293B class SRC src class ST stage class REC rec class R53 dns
The staging area holds a continuously updated copy on small instances and cheap EBS volumes, and it serves no users. On failover, DRS launches full-size recovery instances from that data, and you point traffic at them. After the source is repaired, you replicate data back and fail back, and the recovery instances shut down.
| Attribute | DRS | Application Migration Service |
|---|---|---|
| Purpose | Recover from unexpected disaster | Planned permanent migration |
| After completion | Fail back to the source | Source is decommissioned |
| Typical use | Ongoing protection | One-time cutover |
How AWS Backup and Vault Lock Protect Backups
AWS Backup centralises backup policy across supported services, including EC2 and EBS, S3, RDS and Aurora, DynamoDB, DocumentDB, Neptune, EFS, and FSx. A backup plan defines frequency, window, retention, and cold storage transition, and resources join a plan by tag. You can copy recovery points to another Region or another account, which is what turns backups into disaster recovery.
A backup that an attacker can delete is not a real backup, because ransomware crews target backups first. AWS Backup Vault Lock enforces write-once-read-many protection on a vault, with two modes:
- Governance mode: retention is enforced, but users with specific permissions can still remove or change the lock. Use it to test.
- Compliance mode: after a cooling-off period (a minimum of 3 days that you set), the lock cannot be changed or removed by anyone, including the root user, until retention expires.
For stronger isolation, AWS Backup also offers logically air-gapped vaults that you can share for restore across accounts.
SecurityCompliance mode is irreversible once the cooling-off period ends. Test retention values in governance mode on a non-production vault first.
Supporting Tools for Migration and Data Transfer
These tools appear in DR plans and migrations, so know when each applies.
- AWS Database Migration Service (DMS): moves databases with the source staying online. It runs on a replication instance or in serverless mode, and uses change data capture (CDC) to apply ongoing changes so the target stays in sync. Same-engine moves such as PostgreSQL to RDS PostgreSQL need no schema conversion. Different-engine moves such as Oracle to Aurora PostgreSQL need schema conversion first, using DMS Schema Conversion or the Schema Conversion Tool.
- Aurora migration paths from RDS: restore a snapshot for a one-time move, or create an Aurora read replica, wait for lag to reach zero, and promote it when you need the target to stay in sync.
- External MySQL to Aurora: use Percona XtraBackup uploaded to S3 for large databases because physical backups are faster, and
mysqldumpfor small ones. - Large transfers: 200 TB over a 100 Mbps link takes about 185 days, and at a full 1 Gbps about 18.5 days. Use AWS DataSync over Direct Connect or VPN for ongoing sync, and AWS Data Transfer Terminal for physical uploads. AWS Snowball Edge is no longer available to new customers, so plan around DataSync and Direct Connect unless you are an existing Snow customer.
| Scenario | Best option |
|---|---|
| Source and target both live | DMS with CDC |
| RDS to Aurora, one-time | Snapshot restore |
| RDS to Aurora, stay in sync | Read replica, then promote |
| Large external MySQL | XtraBackup via S3 |
| Ongoing large file sync | DataSync over Direct Connect |
Detailed Step-by-Step Practical Lab
You will build a cross-Region backup plan with tag-based selection, run an on-demand backup, restore it, apply Vault Lock in governance mode, optionally add DNS failover, and practise a DRS drill. You need Terraform 1.6 or later, the AWS CLI, and permission to use AWS Backup in ap-south-1 and ap-southeast-1. Step 5 needs a Route 53 hosted zone you own, and Step 6 needs a test server.
Step 1: Define the Backup Foundation in Terraform
This creates a DynamoDB table to protect, two vaults (primary and DR Region), a role, a daily plan with a cross-Region copy, and tag-based selection.
terraform { required_version = ">= 1.6.0" required_providers { aws = { source = "hashicorp/aws" version = "~> 6.0" } }} provider "aws" { region = "ap-south-1" # Mumbai primary} provider "aws" { alias = "dr" region = "ap-southeast-1" # Singapore recovery Region} # Workload to protect. The backup tag puts it in the plan automatically.resource "aws_dynamodb_table" "orders" { name = "razorpay-orders-lab" billing_mode = "PAY_PER_REQUEST" hash_key = "order_id" attribute { name = "order_id" type = "S" } tags = { backup = "daily" }} resource "aws_backup_vault" "primary" { name = "devops-prod-vault"} resource "aws_backup_vault" "dr" { provider = aws.dr name = "devops-dr-vault"} resource "aws_backup_plan" "daily" { name = "devops-daily-backup" rule { rule_name = "daily-5am-utc" target_vault_name = aws_backup_vault.primary.name schedule = "cron(0 5 * * ? *)" # every day at 05:00 UTC lifecycle { delete_after = 35 # keep 35 days } # Copy each recovery point to the DR Region copy_action { destination_vault_arn = aws_backup_vault.dr.arn lifecycle { delete_after = 35 } } }} data "aws_iam_policy_document" "backup_assume" { statement { actions = ["sts:AssumeRole"] principals { type = "Service" identifiers = ["backup.amazonaws.com"] } }} resource "aws_iam_role" "backup" { name = "devops-backup-role" assume_role_policy = data.aws_iam_policy_document.backup_assume.json} resource "aws_iam_role_policy_attachment" "backup" { role = aws_iam_role.backup.name policy_arn = "arn:aws:iam::aws:policy/service-role/AWSBackupServiceRolePolicyForBackup"} resource "aws_iam_role_policy_attachment" "restore" { role = aws_iam_role.backup.name policy_arn = "arn:aws:iam::aws:policy/service-role/AWSBackupServiceRolePolicyForRestores"} # Any resource tagged backup=daily joins the planresource "aws_backup_selection" "tagged" { name = "tag-backup-daily" plan_id = aws_backup_plan.daily.id iam_role_arn = aws_iam_role.backup.arn selection_tag { type = "STRINGEQUALS" key = "backup" value = "daily" }} output "orders_table_arn" { value = aws_dynamodb_table.orders.arn} output "backup_role_arn" { value = aws_iam_role.backup.arn}terraform initterraform applyStep 2: Run an On-Demand Backup
Do not wait for the schedule. Start a backup now and watch it complete.
TABLE_ARN=$(terraform output -raw orders_table_arn)ROLE_ARN=$(terraform output -raw backup_role_arn) aws backup start-backup-job \ --backup-vault-name devops-prod-vault \ --resource-arn "$TABLE_ARN" \ --iam-role-arn "$ROLE_ARN" \ --lifecycle DeleteAfterDays=7 \ --region ap-south-1 aws backup list-backup-jobs \ --by-resource-arn "$TABLE_ARN" \ --query 'BackupJobs[].[BackupJobId,State]' \ --output table \ --region ap-south-1# Re-run until State is COMPLETEDStep 3: Prove the Restore Works
A backup you have never restored is a hope, not a plan. Restore into a new table and check it.
RP_ARN=$(aws backup list-recovery-points-by-backup-vault \ --backup-vault-name devops-prod-vault \ --query 'RecoveryPoints[0].RecoveryPointArn' \ --output text --region ap-south-1) aws backup start-restore-job \ --recovery-point-arn "$RP_ARN" \ --iam-role-arn "$ROLE_ARN" \ --metadata targetTableName=razorpay-orders-restored \ --region ap-south-1 # Use the RestoreJobId from the previous outputaws backup describe-restore-job \ --restore-job-id RESTORE_JOB_ID \ --region ap-south-1When the status is COMPLETED, the table razorpay-orders-restored exists. Time this step: that duration is a real input to your RTO.
Step 4: Add Vault Lock in Governance Mode
Governance mode enforces retention but lets you undo the lock, which is what you want in a lab. Add this to main.tf and apply.
resource "aws_backup_vault_lock_configuration" "primary" { backup_vault_name = aws_backup_vault.primary.name min_retention_days = 7 # recovery points cannot be deleted before 7 days max_retention_days = 365 # Do NOT set changeable_for_days here. Setting it (minimum 3) starts a # cooling-off period after which the lock becomes permanent compliance mode.}terraform apply # Prove it: deleting a young recovery point is now refusedaws backup delete-recovery-point \ --backup-vault-name devops-prod-vault \ --recovery-point-arn "$RP_ARN" \ --region ap-south-1# An error occurs: the recovery point is within its minimum retention periodStep 5: Add DNS Failover with Route 53 (Optional)
Warm Standby and Multi-Site need traffic to move automatically. A health check plus failover records does this. Replace the zone and endpoints with your own.
data "aws_route53_zone" "main" { name = "devops.in."} resource "aws_route53_health_check" "primary" { fqdn = "primary.app.devops.in" port = 443 type = "HTTPS" resource_path = "/health" request_interval = 10 failure_threshold = 3 tags = { Name = "primary-app-health" }} resource "aws_route53_record" "app_primary" { zone_id = data.aws_route53_zone.main.zone_id name = "app.devops.in" type = "CNAME" ttl = 60 # a low TTL speeds up the switch records = ["primary.app.devops.in"] set_identifier = "primary" health_check_id = aws_route53_health_check.primary.id failover_routing_policy { type = "PRIMARY" }} resource "aws_route53_record" "app_secondary" { zone_id = data.aws_route53_zone.main.zone_id name = "app.devops.in" type = "CNAME" ttl = 60 records = ["dr.app.devops.in"] set_identifier = "secondary" failover_routing_policy { type = "SECONDARY" }}# Normally resolves to the primary endpointdig +short app.devops.in# After the health check fails, it resolves to dr.app.devops.inStep 6: Practise an Elastic Disaster Recovery Drill
Initialise DRS, then install the AWS Replication Agent on a test server using the exact commands the DRS console shows for your Region and OS. After initial sync, launch a drill, which creates recovery instances without affecting the source.
aws drs initialize-service --region ap-south-1 aws drs describe-source-servers \ --region ap-south-1 \ --query 'items[].[sourceServerID,dataReplicationInfo.dataReplicationState]' \ --output table # Launch a drill, not a real failoveraws drs start-recovery \ --is-drill \ --source-servers sourceServerID=s-0a1b2c3d4e5f67890 \ --region ap-south-1 aws drs describe-jobs --region ap-south-1Check the recovery instance from your own network, record how long it took, then terminate the drill instances from the DRS console so you stop paying for them.
Step 7: Clean Up
Governance-mode Vault Lock blocks deleting young recovery points, so remove the lock first, then empty the vaults, then destroy.
terraform destroy -target=aws_backup_vault_lock_configuration.primary for arn in $(aws backup list-recovery-points-by-backup-vault \ --backup-vault-name devops-prod-vault \ --query 'RecoveryPoints[].RecoveryPointArn' --output text --region ap-south-1); do aws backup delete-recovery-point --backup-vault-name devops-prod-vault \ --recovery-point-arn "$arn" --region ap-south-1done for arn in $(aws backup list-recovery-points-by-backup-vault \ --backup-vault-name devops-dr-vault \ --query 'RecoveryPoints[].RecoveryPointArn' --output text --region ap-southeast-1); do aws backup delete-recovery-point --backup-vault-name devops-dr-vault \ --recovery-point-arn "$arn" --region ap-southeast-1done aws dynamodb delete-table --table-name razorpay-orders-restored --region ap-south-1terraform destroyProduction Best Practices & Common Pitfalls
Common MistakeAccepting the default daily snapshot and then discovering your real RPO is 24 hours. Set backup frequency from the RPO the business signed, and use continuous replication when the RPO is minutes.
Common MistakeChoosing Backup and Restore when the requirement is a 30 minute RPO. That needs replicated data in the recovery site, which means Pilot Light or better, not daily snapshots in S3.
Common MistakeEnabling compliance-mode Vault Lock without testing retention values. If you set a minimum retention that is longer than you need, nobody can delete those backups early, not even root.
TipKeep the DR Region fully described in infrastructure as code and pre-bake AMIs. A Pilot Light app tier with a long boot script can take 20 minutes to start instead of 2, so time it every quarter.
SecurityRestrict who can change or remove Vault Lock and delete recovery points using IAM and service control policies, and send backups to a separate account so one compromised account cannot destroy both data and backups.
- Get RPO and RTO in writing before designing. Every other choice follows from those two numbers.
- Test on a schedule. Run a restore test and a failover drill every quarter, and record the real times. AWS Backup restore testing can automate restore checks.
- Use AWS Backup for central policy. Tag-based plans stop services from silently having no backup at all.
- Keep automated database backup retention above zero. Setting it to 0 disables point-in-time recovery, so a truncated table has nothing to restore from. Use at least 7 days for production.
- Watch DMS costs. A DMS replication instance is billed the whole time a long CDC migration runs, so size it to the data volume, and consider serverless DMS for variable load.
- Plan failback. Recovering is half the job. Decide how data returns to the primary site and how you cut traffic back.
Quick Reference & Troubleshooting Commands
| Command | Description |
|---|---|
aws backup list-backup-plans |
List backup plans |
aws backup start-backup-job |
Start an on-demand backup |
aws backup list-backup-jobs |
Check backup job status |
aws backup start-restore-job |
Restore from a recovery point |
aws backup list-recovery-points-by-backup-vault |
List recovery points in a vault |
aws dms describe-replication-instances |
List DMS replication instances |
aws drs describe-source-servers |
Check DRS replication state |
aws drs start-recovery --is-drill |
Launch a DRS drill |
| Problem | Likely fix |
|---|---|
| RPO exceeds the SLA | Raise backup frequency or use continuous replication |
| RTO exceeds the SLA | Move to a strategy with more running, such as Warm Standby |
| DMS target is missing recent writes | Enable CDC from the start of the full load |
| Pilot Light app tier starts slowly | Pre-bake the AMI and shorten the boot script |
| Cannot delete a recovery point | Check Vault Lock minimum retention |
| Restore job fails | Check the role has the restore policy and the target name is free |