Lesson 4 of 4 High Availability and Disaster Recovery

Replicating Data Across Regions and Running Failovers

This lesson covers the AWS features that move data between Regions and how to run and test a failover, since a DR strategy is only as good as its replication and procedure.

Learning outcomes

After completing this lesson, you will be able to:

  • Choose a cross-Region mechanism for each data store.
  • Run a failover with a runbook.
  • Test DR plans and avoid common failures.

Replicating data and images

Each data store has its own cross-Region mechanism. The following table lists the main options and their typical recovery point.

DataCross-Region mechanismTypical RPO
AuroraAurora Global Database (storage-level replication; managed switchover and failover)About 1 second
RDSCross-Region read replica (promote on failover) or automated backup replicationSeconds to minutes; or backup interval
DynamoDBGlobal tables (multi-active)About 1 second, or zero with strong consistency mode
S3Cross-Region Replication (CRR); S3 Replication Time Control for a 15-minute SLASeconds to 15 minutes
EBS and AMIsSnapshot and AMI copy (Data Lifecycle Manager or AWS Backup copy rules)Copy schedule
EFSEFS replication to another RegionMinutes
ElastiCacheGlobal DatastoreUnder a second
Container imagesECR replicationMinutes
Secrets and keysSecrets Manager replica secrets; KMS multi-Region keysNear real time
Match the pairs

Cross-Region replication

Exam skills 2.3.4

Match each resource with the way to copy it to a recovery Region.

Log in to try this activity Interactive activities are free with an account.

Running a failover

A DR runbook, ideally automated with Systems Manager Automation or Step Functions, lists the steps in order. The following list shows a typical sequence for a warm standby failover.

  1. Declare the event

    Decide to fail over, based on defined criteria.

  2. Promote the data tier

    Fail over the Aurora Global Database or promote the RDS replica.

  3. Scale up compute

    Raise capacity in the recovery Region (Auto Scaling minimums, ECS desired counts).

  4. Verify

    Test the application with synthetic tests in the recovery Region.

  5. Shift traffic

    Update Route 53 records, turn off an ARC routing control, or adjust Global Accelerator traffic dials.

  6. Monitor and plan failback

    Communicate, and plan the failback, including re-establishing replication in the reverse direction.

The following diagram shows the steps as a sequence.

A warm standby failover runbook in order: declare the event, promote the data tier in the recovery Region, scale up compute, verify health and data, shift traffic with DNS or Application Recovery Controller, and monitor while planning failback. Automating it with Systems Manager Automation or Step Functions makes the order repeatable.
Running the same runbook in tests is what proves the RTO before a real event.
Put in order

A pilot light failover

Exam skills 2.3.4

Put the steps of a pilot light failover in order.

Log in to try this activity Interactive activities are free with an account.

Testing and best practices

DR plans must be tested regularly, because untested plans fail in predictable ways: missing IAM roles or quotas in the recovery Region, AMIs or KMS keys that were not copied, hard-coded Region names, and DNS TTLs longer than the RTO. Good practice includes infrastructure as code for both Regions, the same service quotas in both Regions, AWS Backup restore testing to prove backups restore within the RTO, game days that simulate failures, and monitoring replication lag with alarms. Aurora Global Database switchover performs a planned, zero-data-loss role change, useful for testing, while failover is used for unplanned outages and may lose data up to the replication lag.

Worked example

A failed DR test

During a pilot light test, the team promotes the Aurora secondary in us-west-2 and raises the Auto Scaling group's minimum to 6, but instances fail to launch with Client.InvalidKMSKey.InvalidState. The AMI had been copied to the DR Region re-encrypted with a customer managed key there, but that key's policy does not allow the Auto Scaling service-linked role to use it. After the key policy is fixed, the launches succeed, but the application connects to the old database endpoint hard-coded in its configuration. Both findings go into the runbook, and the database endpoint is moved to a Route 53 private record so failover becomes a DNS change.

Check yourself

Which services give low-RPO cross-Region replication for relational, key-value and object data?

Show answer

Aurora Global Database, DynamoDB global tables and S3 Cross-Region Replication.

Exam Tips

Remember for the exam

  • Aurora Global Database, DynamoDB global tables and S3 CRR provide low-RPO cross-Region replication.
  • Copy AMIs, snapshots, secrets and KMS keys to the DR Region in advance.
  • Automate the failover runbook and test it regularly, including quotas and IAM in the DR Region.
  • Aurora switchover is for planned tests without data loss; failover is for outages.