Skip to main content

Guidance for Cross Region Failover & Graceful Failback on AWS

Overview

This Guidance helps customers design a resilient three-tier web application with a React front end, API/AWS Lambda middle tier, and Amazon Aurora global database back end. The application is deployed across two AWS Regions for automated failover and failback from one Region to another, achieving active and warm standby disaster recovery patterns. Additionally, Amazon CloudWatch supports observability instrumentation for this multi-Region architecture by obtaining insights from application stacks and aggregating them with relevant infrastructure metrics, which can help customers decide when to failover the application to another Region. Amazon Route53 Application Recovery Controller routes traffic between multiple Regions and automates failover through integration with AWS Systems Manager documents.

How it works

Application Running in Primary Region

These technical details feature an architecture diagram to illustrate how to effectively use this solution. The architecture diagram shows the key components and their interactions, providing an overview of the architecture's structure and functionality step-by-step.
Architecture diagram illustrating an AWS cross-region failover and graceful failback solution, featuring primary and secondary regions, Amazon S3, CloudFront, Route 53, API Gateway, AWS Lambda, Aurora Global Postgres DB, AWS WAF, Amazon Cognito, AWS Secrets Manager, and AWS Systems Manager Documents with respective data flows and failover mechanisms.

Cross Region Failover

These technical details feature an architecture diagram to illustrate how to effectively use this solution. The architecture diagram shows the key components and their interactions, providing an overview of the architecture's structure and functionality step-by-step.
Architecture diagram illustrating AWS cross-region failover and graceful failback. It depicts the flow between users, primary and secondary AWS regions, and various AWS services such as Amazon Cognito, AWS WAF, CloudFront, Route 53, Amazon S3, API Gateway, Lambda, Aurora Global Postgres DB, and Systems Manager for handling failover and failback with secrets and document management.

Deploy with confidence

Ready to deploy? Review the sample code on GitHub for detailed deployment instructions to deploy as-is or customize to fit your needs. 

Go to sample code

Well-Architected Pillars

The architecture diagram above is an example of a Solution created with Well-Architected best practices in mind. To be fully Well-Architected, you should follow as many Well-Architected best practices as possible.

This Guidance supports operational excellence by making sure that the business can continue to run business services through failover to a secondary region.

Read the Operational Excellence whitepaper

Use WAF with CloudFront to protect application from common vulnerabilities and use Amazon Cognito to authenticate UI and API access.

Read the Security whitepaper

Automate failure monitor workload’s key performance indicators (KPIs) and trigger automated failover when a threshold is breached.

Read the Reliability whitepaper

Use Amazon API Gateway and Lambda to process transactions in order to avoid provisioned compute resources.

Read the Cost Optimization whitepaper

This Guidance is serverless and minimizes your carbon footprint.

Read the Sustainability whitepaper

Disclaimer

The sample code; software libraries; command line tools; proofs of concept; templates; or other related technology (including any of the foregoing that are provided by our personnel) is provided to you as AWS Content under the AWS Customer Agreement, or the relevant written agreement between you and AWS (whichever applies). You should not use this AWS Content in your production accounts, or on production or other critical data. You are responsible for testing, securing, and optimizing the AWS Content, such as sample code, as appropriate for production grade use based on your specific quality control practices and standards. Deploying AWS Content may incur AWS charges for creating or using AWS chargeable resources, such as running Amazon EC2 instances or using Amazon S3 storage.

References to third-party services or organizations in this Guidance do not imply an endorsement, sponsorship, or affiliation between Amazon or AWS and the third party. Guidance from AWS is a technical starting point, and you can customize your integration with third-party services when you deploy the architecture.