Anatomy of multi-site active/active

Two Regions that both take traffic: what each part does, how writes can be handled, what happens when one Region is impaired, and where AWS says so. Scroll to take it apart.

Scale model of two AWS Regions as stacked layers: load balancers, a fleet of servers and a database in each, requests coming down from above onto both Regions' load balancers, Route 53 on a plate above them with a thin dashed line for the DNS queries, and a line between the two databases with an arrowhead at each end
All anatomiesBack to all anatomies

Drag to turnCtrl + scroll to zoomClick a partDrag to turnTwo fingers to move and zoomTap a part

Multi-site active/active

Two Regions, both serving

Each step of the scroll changes the drawing. Every statement names the AWS page it comes from.

Step 1 of 12

Both Regions serve

The workload runs in Region A and Region B at the same time, and both serve users. Neither Region is kept only for recovery.

“Multi-site active/active serves traffic from all regions to which it is deployed, whereas hot standby serves traffic only from a single region, and the other Region(s) are only used for disaster recovery.”
AWS: Disaster recovery options in the cloud

Step 2 of 12

How requests reach both Regions

Amazon Route 53 or AWS Global Accelerator decides which Region each user goes to: by a percentage for each Region, or, with Route 53, by other policies such as geoproximity or latency.

“For the active/active strategy here, both of these services also enable the definition of policies that determine which users go to which active regional endpoint. With AWS Global Accelerator you set a traffic dial to control the percentage of traffic that is directed to each application endpoint. Amazon Route 53 supports this percentage approach, and also multiple other available policies including geoproximity and latency based ones.”
AWS: Disaster recovery options in the cloud

Step 3 of 12

Read where you are

A common design: each user's reads are served by the Region closest to them, from that Region's own copy of the data.

“It is common to design user reads to be served from the Region closest to them, known as read local.”
AWS: Disaster recovery options in the cloud

Step 4 of 12

Write where you are

AWS offers options for writes. With write local, writes go to the closest Region too; DynamoDB global tables enable it, so both Regions take writes.

“A write local strategy routes writes to the closest Region (just like reads). Amazon DynamoDB global tables enables such a strategy, allowing read and writes from every region your global table is deployed to.”
AWS: Disaster recovery options in the cloud

Step 5 of 12

When writes meet

In the default mode of DynamoDB global tables, multi-Region eventual consistency (MREC), if the same item is changed in both Regions at the same time, DynamoDB keeps the change with the latest internal timestamp, and every replica ends up with that version.

“If the same item is modified in multiple Regions simultaneously, DynamoDB will resolve the conflict by using the modification with the latest internal timestamp on a per-item basis, referred to as a "last writer wins" conflict resolution method. An item will eventually converge in all replicas to the version created by the last write.”
AWS: How DynamoDB global tables work

Step 6 of 12

Another way to write

With write global, every write goes to the same Region, as with Aurora Global Database; if that Region is impaired, another is promoted.

“A write global strategy routes all writes to a single Region. In case of failure of that Region, another Region would be promoted to accept writes.”
AWS: Disaster recovery options in the cloud

Step 7 of 12

Region A is impaired

A service disruption stops Region A from answering. Region B keeps serving its own users.

This step is the scenario, not a statement from AWS.

Step 8 of 12

No failover

In multi-site active/active the workload already runs in Region B too, so there is no failover.

“With multi-site active/active, because the workload is running in more than one Region, there is no such thing as failover in this scenario.”
AWS: Disaster recovery options in the cloud

Step 9 of 12

Route 53 stops answering with Region A

With Evaluate target health set to Yes on each Region's alias record, Route 53 follows the health of each load balancer's target groups. With Region A impaired, if its load balancer's target groups hold only unhealthy targets, that load balancer is considered unhealthy, and Route 53 routes queries to other resources: here, Region B's load balancer.

“If any target group contains only unhealthy targets, the load balancer is considered unhealthy, and Route 53 routes queries to other resources.”
AWS: AliasTarget (Route 53 API Reference)

Step 10 of 12

Can Region B carry it all?

AWS says to test it: with Region A impaired, can Region B handle all the traffic?

“Disaster recovery testing in this case would focus on how the workload reacts to loss of a Region: Is traffic routed away from the failed Region? Can the other Region(s) handle all the traffic?”
AWS: Disaster recovery options in the cloud

Step 11 of 12

Writes caught in Region A

Changes Region A took but had not yet copied are copied to Region B when Region A's replica is healthy again.

“In the unlikely event a replica in a MREC global table becomes isolated or impaired, any data not yet replicated to other Regions will be replicated when the replica becomes healthy.”
AWS: How DynamoDB global tables work

Step 12 of 12

What a copy cannot save

In multi-site active/active, backup and recovery are still needed. Data that was corrupted or deleted comes back only to a point before the damage was discovered.

“Backup and recovery are still required and should be tested regularly. It should also be noted that recovery times for a data disaster involving data corruption, deletion, or obfuscation will always be greater than zero and the recovery point will always be at some point before the disaster was discovered.”
AWS: Disaster recovery options in the cloud

The parts

Tap one, or tap it on the model

The parts

Amazon Route 53

Answers the name with a Region, and leaves out a Region whose load balancer is unhealthy.

  • What Route 53 calls active-active failover. “In active-active failover, all the records that have the same name, the same type (such as A or AAAA), and the same routing policy (such as weighted or latency) are active unless Route 53 considers them unhealthy.”
  • Lowest latency, among the policies. “If your application is hosted in multiple AWS Regions, you can improve performance for your users by serving their requests from the AWS Region with the lowest latency.” AWS: Latency-based routing
  • Load balancers: Evaluate target health. “For load balancers (ELB) and AWS Elastic Beanstalk environments with load balancers, setting Evaluate target health to Yes allows Route 53 to route traffic away from unhealthy resources.” AWS: Values specific for simple alias records
  • Or AWS Global Accelerator. “With a standard accelerator, Global Accelerator directs traffic over the AWS global network to endpoints in the nearest Region to the client.” AWS: What is AWS Global Accelerator?
AWS: Active-active and active-passive failover

Elastic Load Balancing

The front door of each Region, both taking requests.

  • Spreads the load. “Elastic Load Balancing automatically distributes your incoming traffic across multiple targets, such as EC2 instances, containers, and IP addresses, in one or more Availability Zones.”
  • Only to healthy targets. “It monitors the health of its registered targets, and routes traffic only to the healthy targets.”
  • Grows by itself. “Elastic Load Balancing scales your load balancer capacity automatically in response to changes in incoming traffic.”
AWS: What is Elastic Load Balancing?

The fleet, in each Region

Amazon EC2 Auto Scaling groups, serving users in both Regions.

  • A full environment, used. “Most customers find that if they are going to stand up a full environment in the second Region, it makes sense to use it active/active.”
  • Static stability, in general. “Build systems that operate in one mode by provisioning enough capacity in each Availability Zone or Region to carry the full load if one location is lost.” AWS Well-Architected: REL11-BP05
  • Deployed across Regions. “CloudFormation StackSets extends the capability of stacks by allowing you to create, update, or delete stacks across multiple accounts and AWS Regions with a single operation.” AWS: Managing stacks across accounts and Regions with StackSets
AWS: Disaster recovery options in the cloud

Amazon DynamoDB global tables

The data, in both Regions. Each Region reads and writes its own replica.

  • Copied both ways. “Item changes in an MREC global table replica are asynchronously replicated to all other replicas, typically within a second or less.”
  • Another mode: strong consistency. “MRSC global tables support a Recovery Point Objective (RPO) of zero.” “A MRSC global table must be deployed in exactly three Regions.”
  • Write global: Aurora Global Database. “Only the primary cluster performs write operations.” AWS: Using Amazon Aurora Global Database
  • Write partitioned: Amazon S3 replication both ways. “A write partitioned strategy assigns writes to a specific Region based on a partition key (like user ID) to avoid write conflicts.” AWS: Disaster recovery options in the cloud
AWS: How DynamoDB global tables work

Backups

What protects data that was deleted or corrupted and then copied.

  • Replication copies damage too. “Continuous replication copies corruption and deletion to the recovery site as faithfully as it copies good data.”
  • Every strategy. “Every strategy therefore needs point-in-time backups or versioning in addition to replication, so you can recover to a moment before the data was damaged.”
  • Continuous backups of the table. “Amazon DynamoDB point-in-time recovery (PITR) provides automatic continuous backups of your DynamoDB table data.” AWS: Point-in-time backups for DynamoDB
  • Across Regions. “Use AWS Backup to schedule and monitor cross-Region backups.”
AWS Well-Architected: REL13-BP02