© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Best practices for building multi-region, active-active serverless applications
S V S 3 3 7 - R
Adrian Hornsby
Principal Evangelist
Amazon Web Services
Why build a global architecture?
Once upon a time …
Origin
And now . . .
Origin
~300 ms
Origin
Improve latency for end users
Origin
Improve availability and disaster recovery
Applications in
US West
Applications in
US East
Users from
San FranciscoUsers from
New York
Service 1
Service 2
Service 3
Service 4
Service 1
Service 2
Service 3
Service 4
Amazon global network
Origin
Cross-region VPC peering
Origin
Amazon S3 cross-region replication
Bucket with
objects
Bucket with
objects
Amazon DynamoDB global table
https://aws.amazon.com/blogs/aws/new-convert-your-single-region-amazon-dynamodb-tables-to-global-tables/
Active-Active | Active-Passive | What to do?
Serverless cost model is a huge advantage here!
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon Route 53 > Amazon API Gateway >AWS Lambda > Amazon DynamoDB
Global Table
https://global.adhorn.me
AWS Lambda
AWS Lambda
Amazon DynamoDB
Amazon DynamoDB
Amazon API Gateway
Amazon API Gateway
Amazon Route 53
Region
Region us-east-1
Region
Region us-west-2
Multi-region with Route 53 Amazon Route 53
Latency-based routing
Application Application
Amazon Route 53
Region Region
Geo-based routing
Application Application
Amazon Route 53
Region Region
Weighted round-robin routing
Application Application
Amazon Route 53
Region Region
DNS failover
Application Application
Region Region
Amazon Route 53
Global Table
Amazon DynamoDB
Amazon DynamoDB
Region
Region
Region us-east-1
Region us-west-2
Global Table
AWS Lambda
AWS Lambda
Amazon DynamoDB
Amazon DynamoDB
Region
Region
Region us-east-1
Region us-west-2
https://globalddb.adhorn.me
Regional
API
Endpoint
Custom
Domain
Name
Regional
API
Endpoint
Custom
Domain
Name
API Gateway
Amazon API Gateway
Amazon API Gateway
AWS Lambda
AWS Lambda
Amazon Route 53
Region
Region
Route 53: Traffic policy
Health checks with Route 53
Global Table
https://global.adhorn.me
AWS Lambda
AWS Lambda
Amazon DynamoDB
Amazon DynamoDB
Amazon API Gateway
Amazon API Gateway
Amazon Route 53
Region
Region us-east-1
Region
Region us-west-2
Voilà!
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Global Accelerator > Application Load Balancer > Lambda > DynamoDB
Global Table
AWS Lambda
AWS Lambda
Amazon DynamoDB
Amazon DynamoDB
AWS Global Accelerator
Application Load Balancer
Application Load Balancer
Region
Region eu-central-1
Region
Region us-west-2
AWS Global Accelerator
Global Table
Amazon DynamoDB
Amazon DynamoDB
Region
Region eu-central-1
Region
Region us-west-2
Global Table
AWS Lambda
AWS Lambda
Amazon DynamoDB
Amazon DynamoDB
Region
Region eu-central-1
Region
Region us-west-2
Global Table
AWS Lambda
AWS Lambda
Amazon DynamoDB
Amazon DynamoDB
Application Load Balancer
Application Load Balancer
Region
Region eu-central-1
Region
Region us-west-2
Global Table
AWS Lambda
AWS Lambda
Amazon DynamoDB
Amazon DynamoDB
AWS Global Accelerator
Application Load Balancer
Application Load Balancer
Voilà!Region
Region eu-central-1
Region
Region us-west-2
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
https://medium.com/@adhorn
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Free, on-demand courses on serverless, including Deep Dive: Lambda@Edge and Deep Dive on AWS Fargate
Visit the Learning Library at https://aws.training
Additional digital and classroom trainings cover modern application development and computing
Learn serverless with AWS Training and CertificationResources created by the experts at AWS to help you learn modern application development
Thank you!
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Adrian Hornsby
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.