Sub topic 9
Warm standby: a scaled-down running copy
Warm standby keeps a complete, working copy of the workload in the recovery Region, running at reduced capacity. This chapter assumes you know the following:
- RTO and RPO.
- Cross-Region replication options such as Aurora global database and DynamoDB global tables.
- Route 53 failover records.
- Auto Scaling groups.
What warm standby keeps running
In pilot light, only the data tier runs in the DR Region. The compute layer is defined but switched off or set to zero. Warm standby goes further. Every tier of the application runs all the time: load balancer, application servers, and a live database replica. Each tier runs at a fraction of production size.
Because the copy is live, you can send it a request at any moment and get a correct answer. A pilot light environment needs a build step before it can do that. A warm standby environment doesn't.
| Component | Production Region | Warm standby Region |
|---|---|---|
| Load balancer | Running | Running |
| Application fleet | 12 instances | 2 to 4 instances |
| Database | Aurora writer and readers | Aurora secondary cluster with one small reader |
| Data replication | Source | Continuous, asynchronous |
| Traffic | 100% | 0% (or a small test share) |
The "scaled-down" part is the main tuning decision. At 25% of production size, a failover needs a 4x scale-up. At 50%, you need 2x, which is faster and less risky but costs more every month.
How a failover works
A warm standby failover has three jobs, and they can run in parallel:
- Scale the compute fleet up to production capacity.
- Promote the database in the DR Region to be the writer.
- Move traffic to the DR Region.
The following diagram shows the flow.
Compare this with the other strategies. Backup and restore has to rebuild everything. Pilot light has to start compute and then scale it. Warm standby only has to scale and promote, so its RTO is usually minutes. Multi-site active/active skips even that step because both Regions already serve traffic.
Keeping the standby in sync
A standby that has drifted from production fails at the worst moment. Three things must stay current.
Data. Use a replication mechanism that matches your RPO:
- Aurora global database replicates storage with typical lag under a second.
- DynamoDB global tables replicate between Regions, and every replica accepts writes.
- S3 Cross-Region Replication copies objects asynchronously.
Warm standby does not remove the RPO. Replication is asynchronous, so writes made just before the failure can be lost. Monitor the lag, for example with the AuroraGlobalDBReplicationLag CloudWatch metric, and alarm when it exceeds your RPO.
Infrastructure. Deploy the same infrastructure-as-code templates to both Regions, with parameters for size. A CloudFormation or Terraform stack that differs only in DesiredCapacity and instance counts is easy to reason about. Manual changes in one Region are the usual cause of drift.
Application versions. Your CI/CD pipeline should deploy every release to both Regions. If the standby runs last month's build, its schema or API may not match the replicated data.
Scaling up during failover
The Auto Scaling group in the DR Region keeps a small minimum size. During failover, raise the minimum and desired capacity so the group does not scale back down:
# Scale the dormant DR Auto Scaling group up from its minimal size
aws autoscaling update-auto-scaling-group \
--region us-west-2 \
--auto-scaling-group-name app-dr \
--min-size 4 \
--desired-capacity 4 \
--max-size 12
# Planned switchover of an Aurora global database to the DR Region's cluster
aws rds failover-global-cluster \
--region us-west-2 \
--global-cluster-identifier app-global \
--target-db-cluster-identifier arn:aws:rds:us-west-2:111122223333:cluster:app-dr-clusterThe second command needs care. Without --allow-data-loss, failover-global-cluster is a managed, planned switchover. It waits for the secondary to catch up and needs both Regions to be healthy. That fits a DR drill or a planned migration. In a real Regional outage the primary cluster is unreachable. You then have two options:
- Run
failover-global-clusterwith--allow-data-loss. - Detach the secondary cluster with
aws rds remove-from-global-cluster, which promotes it to a standalone writer.
Both accept that the most recent writes may be lost. Write down which option your runbook uses before the incident.
Redirecting traffic
Use Route 53 failover records with a health check on the primary. The change batch below creates a primary and a secondary record for app.example.com:
{
"Changes": [
{
"Action": "UPSERT",
"ResourceRecordSet": {
"Name": "app.example.com",
"Type": "CNAME",
"SetIdentifier": "primary",
"Failover": "PRIMARY",
"TTL": 60,
"HealthCheckId": "REPLACE_WITH_HEALTH_CHECK_ID",
"ResourceRecords": [
{ "Value": "primary-alb.us-east-1.elb.amazonaws.com" }
]
}
},
{
"Action": "UPSERT",
"ResourceRecordSet": {
"Name": "app.example.com",
"Type": "CNAME",
"SetIdentifier": "secondary",
"Failover": "SECONDARY",
"TTL": 60,
"ResourceRecords": [
{ "Value": "dr-alb.us-west-2.elb.amazonaws.com" }
]
}
}
]
}Apply it with aws route53 change-resource-record-sets --hosted-zone-id <zone-id> --change-batch file://failover.json.
There is a trap here. With this configuration, Route 53 switches to the secondary as soon as the primary health check fails. That can happen before your DR fleet has scaled up and before the database is promoted. The standby then receives full production traffic with 2 instances and a read-only database.
You have three ways to handle this:
- Automatic failover with a pre-warmed standby. Size the standby large enough to absorb the initial load, and let Auto Scaling policies handle the rest. The writer must still be promoted, so writes fail until that happens.
- Manual failover. Set the health check as inverted or controlled by a CloudWatch alarm or Route 53 Application Recovery Controller routing control. A person or a script flips traffic after scale-up and promotion finish.
- Global Accelerator. Use endpoint weights or traffic dials to move traffic without waiting for DNS caches to expire. Clients keep the same static anycast IP addresses.
Most teams choose a manual or semi-automated decision. A false-positive automatic failover is costly, because it splits traffic and writers across Regions.
Failback
Failback is the return to the original Region. With Aurora global database, the old primary must rejoin as a secondary of the new primary. Then you run another switchover once it has caught up. Treat this as a planned change during a quiet period, not an emergency. Many teams leave the DR Region as the new primary for weeks and rebuild a standby in the original Region.
Testing
A warm standby has one great advantage: you can send it real traffic. Use a weighted record to send 1% to 5% of requests to the DR Region regularly. That proves the environment works, and you see problems such as missing secrets, expired certificates, or IAM roles that exist only in the primary Region. Run a full scale-up and switchover drill at least twice a year and record the measured RTO and RPO.
Cost and when to choose it
The monthly cost is roughly the DR fleet, the replica database, the load balancer, data transfer between Regions, and replicated storage. It sits between pilot light and active/active. Warm standby fits workloads where:
- The RTO is in minutes and the RPO is seconds to minutes.
- A brief period of reduced capacity or degraded performance is acceptable after failover.
- The team does not want the complexity of conflict resolution and multi-writer data in active/active.
If you can't tolerate even minutes of downtime, look at active/active. If the RTO is hours, pilot light costs less.
Exercise
Your warm standby runs 3 instances against production's 12. The Route 53 failover record is set to fail over automatically, and the DR Aurora cluster is a read-only secondary. The primary Region fails. Name two problems you will see in the first minutes, and one change that reduces each.
Show answer
First, the DR fleet gets full production traffic with only 3 instances, so it can be overloaded. Fix this by raising the standby size, by setting Auto Scaling target-tracking policies so the fleet grows quickly, or by raising capacity before shifting traffic. Second, the database is still a read-only secondary, so every write fails until it is promoted. Fix this by promoting the cluster (failover-global-cluster with --allow-data-loss, or remove-from-global-cluster) before or as traffic shifts. Controlling the shift with a manual step or a routing control, instead of an automatic health check, lets both steps finish first.