Sub topic 10
Multi-site active/active: serving traffic from multiple Regions
This chapter assumes you know the other three DR strategies, Route 53 routing policies, and the basics of DynamoDB and Aurora. It also assumes you can read AWS CLI commands and JSON.
In multi-site active/active, two or more Regions run the full workload at the same time. Each Region serves real user traffic. If one Region fails, the others keep serving, and users see a short disruption or none. Of the four strategies, this one has the lowest recovery time and the highest cost and complexity.
What makes it different from warm standby
Warm standby keeps a scaled-down copy that serves no users until you fail over. Active/active removes that idle copy. Three things change:
- Every Region takes traffic all the time. There is no "switch on" step. Failover means that a routing layer stops sending users to the unhealthy Region.
- Every Region must accept writes, or must forward them. The data layer is the hard part of the design.
- The standing cost is higher. You pay for full capacity in each Region, plus cross-Region data transfer.
Target recovery values are roughly an RTO (recovery time objective) of seconds to a couple of minutes and an RPO (recovery point objective) of near zero to a few seconds. The exact values depend on the data services you choose.
The data layer
Compute is easy to duplicate. Data is not, because two Regions can change the same record at the same time. Choose a service by how it handles concurrent writes.
| Service | Write model | Typical cross-Region lag | Notes |
|---|---|---|---|
| DynamoDB global tables (multi-Region eventual consistency) | Multi-writer, every replica accepts writes | Usually about a second or less | Conflicts resolve by last writer wins |
| DynamoDB global tables (multi-Region strong consistency) | Multi-writer, synchronous replication | RPO of zero | Higher write latency, limited to a set of Regions, and you must use a witness or a third replica |
| Aurora Global Database | One primary Region, read-only secondaries | Typically under a second | Write forwarding lets secondaries accept writes, but the primary Region still commits them |
| S3 with Cross-Region Replication | Asynchronous object copy | Usually seconds to minutes | Pair with S3 Multi-Region Access Points for one global endpoint |
Two points need attention.
First, Aurora Global Database is not truly multi-writer. A design using it with write forwarding can serve reads locally from every Region. Every write still travels to one primary Region. If that Region fails, you must promote a secondary, which takes minutes. Many teams still call this "active/active" for the application tier, but its recovery time is closer to warm standby for writes. Be exact about this when you set expectations.
Second, DynamoDB global tables with eventual consistency resolve conflicts by last writer wins, using timestamps. If two Regions update the same item within the replication window, one update is silently overwritten. Design for this:
- Route each user, tenant, or item to a "home" Region, so one Region normally writes a given item.
- Use writes that do not conflict, such as appending new items rather than updating shared counters.
- Use conditional writes, but remember a condition is checked only against the local replica.
Create a global table like this:
# Create the table in the first Region with streams enabled
aws dynamodb create-table \
--region us-east-1 \
--table-name orders \
--attribute-definitions AttributeName=orderId,AttributeType=S \
--key-schema AttributeName=orderId,KeyType=HASH \
--billing-mode PAY_PER_REQUEST \
--stream-specification StreamEnabled=true,StreamViewType=NEW_AND_OLD_IMAGES
# Wait until the table is active, then add a replica in a second Region
aws dynamodb wait table-exists --region us-east-1 --table-name orders
aws dynamodb update-table \
--region us-east-1 \
--table-name orders \
--replica-updates 'Create={RegionName=us-west-2}'Once the replica is active, your application in each Region writes to its local endpoint and DynamoDB replicates the changes.
Routing traffic
You have two main tools, and they fail over differently.
Route 53 latency-based routing answers each DNS query with the record for the Region that has the lowest latency to the user. Attach a health check to each record. When a check fails, Route 53 stops returning that record and returns the next best Region. Clients keep using a cached answer until its TTL (time to live) expires, so a 60-second TTL means some users wait up to about a minute, plus the time the health check needs to detect failure. Some clients and resolvers ignore low TTLs, so a few users take longer.
AWS Global Accelerator gives you two static anycast IP addresses. Traffic enters the AWS network at the nearest edge location and goes to the closest healthy endpoint group (one per Region). Global Accelerator does not depend on DNS caching, so failover for unhealthy endpoints is usually faster, often well under a minute. You can also set a traffic dial per Region to shift load gradually. It costs extra, and it works with ALBs, NLBs, EC2 instances, and Elastic IPs.
This change batch creates two latency records for one name:
{
"Changes": [
{
"Action": "UPSERT",
"ResourceRecordSet": {
"Name": "app.example.com",
"Type": "CNAME",
"SetIdentifier": "us-east-1",
"Region": "us-east-1",
"TTL": 60,
"HealthCheckId": "REPLACE_WITH_EAST_HEALTH_CHECK_ID",
"ResourceRecords": [
{ "Value": "east-alb.us-east-1.elb.amazonaws.com" }
]
}
},
{
"Action": "UPSERT",
"ResourceRecordSet": {
"Name": "app.example.com",
"Type": "CNAME",
"SetIdentifier": "us-west-2",
"Region": "us-west-2",
"TTL": 60,
"HealthCheckId": "REPLACE_WITH_WEST_HEALTH_CHECK_ID",
"ResourceRecords": [
{ "Value": "west-alb.us-west-2.elb.amazonaws.com" }
]
}
}
]
}Apply it with aws route53 change-resource-record-sets --hosted-zone-id YOUR_ZONE_ID --change-batch file://latency.json. Compare it with the failover records from the earlier chapters. There, one record is primary and one is secondary. Here, both records are equal and the user's location picks between them.
Capacity: the cost you must not skip
When one Region fails, its users move to the others. If each Region runs at 60 percent of its capacity, the survivor must absorb 120 percent of one Region's normal load and will fail. Choose one of these approaches:
- Full headroom. Size each Region to carry all traffic alone. This is the safest option and the most expensive. With two Regions, you pay for about double the capacity you use.
- Auto Scaling with pre-warming. Run less headroom and rely on scaling. Scaling takes minutes, and a sudden doubling of traffic can hit scaling limits, so verify your service quotas in every Region.
- Load shedding. Accept that some low-priority traffic gets rejected during failover and keep critical paths available.
Request quota increases in all Regions ahead of time. Quota errors during a failover are a common and avoidable failure.
Failure modes and edge cases
Active/active protects against loss of a Region. It does not protect against everything.
- Data corruption replicates. A bad deploy or a buggy batch job that deletes records spreads to every replica within seconds. Replication is not a backup. Keep point-in-time recovery (DynamoDB PITR, Aurora backtrack or snapshots) and AWS Backup copies as well.
- Split brain and partitions. If the link between Regions breaks, both sides keep accepting writes and diverge. With last-writer-wins, the merge after the link returns can discard valid updates.
- Idempotency. Retried requests may land in a different Region. Use idempotency keys so a payment or order is not applied twice.
- Shared regional dependencies. Check what each Region needs to start: secrets, KMS keys (use multi-Region keys), container images (replicate your ECR repositories), and third-party APIs.
- Control plane versus data plane. During a major event, creating or editing resources, such as Route 53 records, can fail even though existing resources keep working. Design failover to use data plane actions, such as health checks and routing already in place, rather than API calls you make in the middle of an incident.
- Operational drift. Two Regions that are both live are easy to let diverge. Deploy both from the same infrastructure as code and pipeline, and roll out changes one Region at a time.
When to choose it
Pick active/active when the workload cannot tolerate minutes of downtime, the business impact of an outage justifies roughly double the infrastructure cost, and the team can handle multi-writer data design. If a few minutes of write downtime is acceptable, warm standby with Aurora Global Database is usually cheaper and simpler.
Exercise
A two-Region active/active application runs each Region at 70 percent CPU at peak. Route 53 latency routing fails over one Region's users to the other. What goes wrong, and name two ways to prevent it?
Show answer
The surviving Region receives about twice its normal peak load, roughly 140 percent of its capacity, so it overloads and may fail too. Prevent this by sizing each Region to carry all traffic alone (full headroom), by using Auto Scaling with raised service quotas in both Regions and testing how fast it scales, or by adding load shedding so low-priority requests are rejected while critical ones succeed.
Exercise
Your application writes the same DynamoDB item from both Regions, using a global table with eventual consistency. Which problem can occur, and how can you reduce it?
Show answer
Concurrent writes within the replication window are resolved by last writer wins, so one update is silently lost. Reduce it by assigning each item a home Region that handles its writes, by using append-only or non-conflicting write patterns, or by choosing multi-Region strong consistency when your Regions allow it and you can accept higher write latency.