Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Building Multi-Region Serverless Architecture a...

Building Multi-Region Serverless Architecture and Breaking them using Chaos Engineering

Customers are often looking at running their services at global scale, deploying applications to multiple regions. While it has traditionally been hard to do this, often requiring months of engineering work, serverless has changed the game!
This hands-on talk will help you understand how to build different versions of a multi-region, active-active serverless backend.
Come learn the pros-and-cons of DNS routing versus IP Anycast, and see how you can leverage serverless services like Route 53, Global Accelerator, API Gateway, the Application Load Balancer, AWS Lambda and DynamoDB Global tables to build global scale, serverless applications.
While having a multi-region architecture increases the availability of your application, it also brings new sets of challenges.
One of these challenge is ensuring that the failover procedures work when needed since the last thing you want during a disaster is fixing the failover procedures. This session will also look into using chaos engineering techniques to make sure that when the real disaster happens, the failover is successful.

Adrian Hornsby

February 03, 2020
Tweet

More Decks by Adrian Hornsby

Other Decks in Technology

Transcript

  1. © 2020, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Building multi-region, active-active serverless applications Adrian Hornsby Principal Evangelist Amazon Web Services @adhorn
  2. Improve availability and disaster recovery Applications in US West Applications

    in US East Users from San Francisco Users from New York Service 1 Service 2 Service 3 Service 4 Service 1 Service 2 Service 3 Service 4
  3. Build high performance, globally distributed applications Low latency reads &

    writes to locally available tables Disaster proof with multi-region redundancy Easy to set up and no application rewrites required Globally dispersed users Replica (N. America) Replica (Europe) Replica (Asia) Global App Global Table Amazon DynamoDB Global Tables Fully managed, multi-master, multi-region database
  4. © 2020, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Route 53 > API Gateway > Lambda > DynamoDB
  5. 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
  6. Global Table AWS Lambda AWS Lambda Amazon DynamoDB Amazon DynamoDB

    Region Region Region us-east-1 Region us-west-2
  7. 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
  8. 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à!
  9. © 2020, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Global Accelerator > Load Balancer > Lambda > DynamoDB
  10. 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
  11. Global Table AWS Lambda AWS Lambda Amazon DynamoDB Amazon DynamoDB

    Region Region eu-central-1 Region Region us-west-2
  12. 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
  13. 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
  14. Write Once, Run Lambda Functions Globally N Virginia AWS Location

    AWS Location AWS Location AWS Location AWS Location AWS Location
  15. Lambda@Edge Programming Model exports.handler = (event, context, callback) => {

    /* viewer-request and origin-request events * have the request as input */ const request = event.Records[0].cf.request; /* viewer-response and origin-response events * have the response as input */ const response = event.Records[0].cf.response; /* Do the processing – say add a header */ /* When I am done I let CloudFront what to do next */ callback(null, request); }
  16. #awssummit Multi-region setup • Data from a customer in only

    1 region • US-West-1 ! / EU-West-1 " • Dynamic routing with DynamoDB • VPC Peering
  17. #awssummit High Latency for global teams Customers with global teams

    experience very high latencies when their API traffic is routed to their “home” region through a different intermediate region.
  18. #awssummit Takeaways Great impact for our global customers : up

    to 50% latency reduction 0 0.5 1 1.5 2 2.5 AVG P50 P95 P99
  19. Thank you! © 2020, Amazon Web Services, Inc. or its

    affiliates. All rights reserved. Adrian Hornsby [email protected]