Sub topic 7
Pilot light: a minimal always-on core
This chapter assumes you know the backup and restore strategy from earlier chapters, understand RTO and RPO, and can read AWS CLI commands and JSON. It also assumes you have used Auto Scaling groups, Application Load Balancers, and Aurora or DynamoDB.
The idea
A pilot light keeps the smallest part of your workload running in the recovery Region, and leaves everything else switched off. The name comes from a gas heater, where a small flame stays lit so the main burner can ignite quickly.
The part that stays lit is the data tier. Data cannot be rebuilt on demand in minutes, so it must already be in the recovery Region and kept current by replication. The application tier (web servers, app servers, queues, caches) is defined and ready, but runs at zero or minimal capacity. During a disaster you start it, and then you send traffic to it.
This sits between backup and restore and warm standby:
| Strategy | Data in DR Region | Compute in DR Region | Typical RPO | Typical RTO |
|---|---|---|---|---|
| Backup and restore | Backup copies only | None, built from IaC at recovery time | Hours | Hours |
| Pilot light | Live replica, continuously updated | Defined but off or at minimal size | Seconds to minutes | Tens of minutes |
| Warm standby | Live replica | Full stack running at reduced size | Seconds to minutes | Minutes |
| Multi-site active/active | Live, writable in each Region | Full stack serving traffic | Near zero | Near zero to seconds |
The two advantages over backup and restore are that you do not restore data (a restore can take hours for a large database) and that your RPO is set by replication lag instead of backup frequency.
What stays on and what stays off
Decide the split for each component. A common layout:
- Always on: a replicated database (an Aurora global database secondary cluster, a DynamoDB global table replica, or an RDS cross-Region read replica), S3 buckets with cross-Region replication, replicated secrets and encryption keys, and the VPC with its subnets and security groups.
- Defined but idle: AMIs copied to the DR Region, launch templates, an Auto Scaling group with minimum and desired capacity of 0, a load balancer and target group, and Route 53 records.
- Not present until failover: most application servers, scaled-out caches, and any resource that costs a lot per hour when idle (NAT gateways, large instances).
Some teams keep a single small instance running so they can see that the DR Region's application tier works. That is still a pilot light, as long as the compute is a small fraction of production.
How recovery flows
Recovery time is the sum of detection, the decision to fail over, database promotion, instance launch and boot time, health check passing, and DNS propagation. Each step adds to your RTO, so measure each one.
The data tier
Pick the replication mechanism that fits the database and your RPO:
- Aurora global database: storage-level replication, usually with lag of about a second. Promoting the secondary cluster typically takes about a minute.
- DynamoDB global tables: multi-Region, multi-writer replicas, so the DR Region can accept writes without a promotion step.
- RDS cross-Region read replica: asynchronous replication. Promotion detaches the replica permanently, so you cannot re-attach it later. Failback means building a new replica in the other direction.
- S3 cross-Region replication: asynchronous and applies only to objects written after the rule is enabled, unless you backfill with S3 Batch Replication.
Replication is not a backup. A bad deployment or a deleted table replicates to the DR Region within seconds. Keep point-in-time recovery or AWS Backup copies alongside the replica, so you can recover from data corruption as well as from a lost Region.
The compute tier
The application tier must start without manual work. Three things make that possible:
- AMIs in the DR Region. An AMI belongs to one Region, so copy it after every build. Automate this in your image pipeline, or the DR Region will boot stale software.
- Infrastructure as code. Deploy the same template to both Regions, with the DR compute set to zero capacity. Differences between Regions should be parameters, not separate templates.
- Region-specific configuration. Parameter Store values, secrets, KMS keys, and certificates must exist in the DR Region. Replicate secrets and use multi-Region KMS keys where you need the same key material.
Scale-up uses the same calls you would use in production. This example is taken from the failover runbook:
# 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 failover-global-cluster command without extra options performs a managed, planned switchover and waits for the secondary to catch up. In a real Region outage the primary may be unreachable, so you need the unplanned path, which accepts data loss up to the replication lag. Check the current CLI reference for the --allow-data-loss and --switchover options before you write your runbook, and rehearse the exact command you will use.
Traffic
Traffic reaches the DR Region through Route 53 failover records or Global Accelerator, as covered in the traffic chapter. With a pilot light there is one extra rule: the health check on the primary will fail the moment the Region is impaired, but the secondary record points at a load balancer with no healthy targets. If DNS flips before compute is ready, users get 503 errors instead of timeouts.
Two ways to handle this:
- Manual or scripted cutover. Keep the DNS switch as the last step of the runbook, after the DR targets are healthy. This gives the lowest risk and a slightly longer RTO.
- Automatic failover to a maintenance page. Let DNS flip automatically to a static S3 or CloudFront page while the runbook brings the stack up.
Set record TTLs low (60 seconds is typical). Some resolvers ignore TTLs, so allow extra time in the RTO.
Failure modes and gotchas
- Capacity is not guaranteed. Scaling from zero in a Region that is absorbing everyone else's failover can hit instance capacity errors. Mitigate with On-Demand Capacity Reservations for critical instance types, multiple instance types in the group, and spreading across all Availability Zones.
- Service quotas are per Region. A DR Region with default limits may not allow 100 instances or enough Elastic IPs. Compare quotas in both Regions and raise them in advance.
- Cold starts. Empty caches and unwarmed load balancers can overload the database right after failover. Plan for staged traffic shifts or pre-warming.
- Configuration drift. The idle stack is rarely used, so it drifts. Deploy every change through the pipeline to both Regions, and run drift detection.
- Hidden dependencies. Anything outside the replicated data tier, such as a third-party endpoint with an IP allow list for the primary Region, will break at failover.
- Replication lag is your real RPO. Alarm on it (for Aurora, the
AuroraGlobalDBReplicationLagmetric) and compare it to your target. - Failback is a separate project. After promotion the DR Region is the source of truth. You must re-establish replication in the reverse direction and then plan a second cutover.
Cost and when it fits
Cost is the data tier, replication traffic, and storage for AMIs and snapshots. Compute is close to zero until failover, which is why a pilot light costs much less than warm standby. Choose it when your RTO allows tens of minutes and your RPO allows seconds to minutes of replication lag. If the business needs recovery in a few minutes, move up to warm standby.
Exercise
Your workload runs in us-east-1 with an Aurora database and an Auto Scaling group. The business sets an RPO of 5 minutes and an RTO of 30 minutes. You build a pilot light in us-west-2. Name what you keep running there, what you keep idle, and two checks you would run before trusting the design.
Show answer
Keep running: an Aurora global database secondary cluster (replication lag of about a second is well inside the 5-minute RPO), S3 replication if the app uses S3, and replicated secrets and KMS keys. Keep idle: an Auto Scaling group at 0 capacity with a launch template, AMIs copied to us-west-2, and a load balancer with Route 53 failover records. Checks: first, alarm on replication lag and confirm it stays under 5 minutes. Second, run a timed failover test (promote the database, scale the group, switch DNS) and confirm the total is under 30 minutes. Also compare service quotas and instance capacity between the two Regions.