This guidance deploys a reference architecture that models a serverless active/passive workload with asynchronous replication of application data and failover from a primary to a secondary AWS Region. To verify that regional failover is working, a sample photo-sharing web application can also be deployed, serving as a visual demonstration for the backend layers. This guidance allows for a 15-minute Recovery Point Objective (RPO) and a Recovery Time Objective (RTO) of a few seconds.
The diagram below presents the architecture you can build using the example code on GitHub.
Multi-Region Application Architecture guidance architecture
The AWS CloudFormation template uses AWS CloudFormation StackSets to deploy the routing layer and back-end infrastructure in both the primary and secondary (failover) AWS Regions. An optional second AWS CloudFormation template can be deployed after the solution’s main template has completed deployment. This second template deploys an AWS Amplify sample web application hosted in an Amazon S3 bucket, an Amazon CloudFront distribution to deliver the web application to users, and an Amazon Cognito user pool and identity pool to enable users to access the web application, the routing layer, and the back-end infrastructure resources.
After the web application loads, it queries the guidance's routing layer for the current state of the application (active, fenced, failover), and configures AWS Amplify to target the guidance’s resources in the correct Region. The state of the application is also retrieved when the user uploads a new photo or adds a comment. Depending on the state of the application, a message may be displayed to indicate whether or not certain actions are available, or if the application must be refreshed.
Browse our library of AWS Solutions Implementations to get answers to common architectural problems.
Find AWS certified consulting and technology partners to help you get started.
Browse our portfolio of Consulting Offers to get AWS-vetted help with solution deployment.