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

Going Global with Serverless!

Going Global with Serverless!

Do you have 50min to spare? Great! I just want 50min of your time to show you how you can deploy a global-scale, multi-region, active-active serverless backend. Oh, and we will do that in less than one hour! You are probably thinking that a few years ago it would have taken six months and a team of ten engineers to do that, and you are right, but serverless has changed the game!

In this session, I walk you through building and deploying a global-scale, multi-region, active-active serverless backend. Demo and hands-on code guaranteed!

Adrian Hornsby

November 21, 2018
Tweet

More Decks by Adrian Hornsby

Other Decks in Programming

Transcript

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

    rights reserved. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Adrian Hornsby, Cloud Architecture Evangelist @adhorn Going Global with Serverless!
  2. © 2018, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. https://xkcd.com/1428/
  3. © 2018, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Failures are a given and everything will eventually fail over time. Werner Vogels CTO – Amazon.com “ “
  4. © 2018, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 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
  5. Improve latency for end-users ~300ms ~140ms 18 Geographic Regions 55

    Availability Zones (AZs) 5 regions and 15 more Availability Zones announced
  6. © 2018, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. AWS Region and availability zones Region Availability zone a Availability zone b Availability zone c data center data center data center data center data center data center data center data center data center
  7. © 2018, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Multi-AZ architecture Region Availability zone a Availability zone b Availability zone c Application Application Application
  8. © 2018, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Multi-region Region Availability zone a Availability zone b Availability zone c Application Region Availability zone a Availability zone b Availability zone c Application Application Application Application Application
  9. © 2018, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. No servers to provision or manage Scales with usage Never pay for idle Availability and fault tolerance built in Why serverless components??
  10. © 2018, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Serverless components Region Availability zone a Availability zone b Availability zone c Serverless Services
  11. © 2018, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Prerequisits to building a multi-region architecture.
  12. © 2018, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. CAP Theorem Consistency Availability Partition Tolerance Data is consistent. All nodes see the same state. Every request is non-failing. Service still responds as expected if some nodes crash. Distributed System In the presence of a network partition, you must choose between consistency and availability!
  13. © 2018, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Embrase eventual consistency … if no new updates are made to a given data item, eventually all accesses to that item will return the last updated value. Availability An eventually consistent system can return any value before it converges!! https://en.wikipedia.org/wiki/Eventual_consistency Distributed System Every request is non-failing.
  14. © 2018, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Secure and reliable global network
  15. © 2018, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Routing policies with Route 53 Region Region Application Application
  16. © 2018, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Latency based routing Region Region Application Application
  17. © 2018, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Geo-based routing Region us-east-1 Region us-west-2 Application Application
  18. © 2018, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Weighted round robin routing Region us-east-1 Region us-west-2 Application Application
  19. © 2018, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. DNS failover Region us-east-1 Region us-west-2 Application Application
  20. © 2018, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Shallow health check Instance Cache node Email database Cluster Are you healthy? yes
  21. © 2018, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Shallow health check Instance Cache node Email database Cluster Are you healthy? yes
  22. © 2018, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Deep health check Instance Cache node Email database Cluster Are you healthy? yes Are you healthy? yes yes yes yes
  23. © 2018, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Deep health check Instance Cache node Email database Cluster Are you healthy? no Are you healthy? no yes yes yes
  24. © 2018, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Region us-east-1 Region us-west-2 https://global.adhorn.me Regional API Endpoint Custom Domain Name Regional API Endpoint Custom Domain Name API Gateway
  25. © 2018, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 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
  26. © 2018, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon S3 cross-region replication Bucket with objects Bucket with objects
  27. © 2018, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Multi-region multi-vpc connectivity Region Region VPC VPC VPC VPC VPC VPC Peering Amazon Backbone Peering https://aws.amazon.com/answers/networking/aws-multiple-region-multi-vpc-connectivity/
  28. © 2018, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Testing multi-region architecture.
  29. © 2018, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. GameDay at Amazon https://www.youtube.com/watch?v=zoz0ZjfrQ9s
  30. © 2018, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Chaos engineering https://github.com/Netflix/SimianArmy
  31. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Amazon Confidential and Trademark © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Hands-on demo
  32. © 2018, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Region us-east-1 Region us-west-2 Global Table https://global.adhorn.me
  33. © 2018, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Region us-east-1 Region us-west-2 Global Table
  34. © 2018, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Region us-east-1 Region us-west-2 Global Table
  35. © 2018, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Region us-east-1 Region us-west-2 Global Table
  36. © 2018, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Region us-east-1 Region us-west-2 Global Table https://globalddb.adhorn.me Voilà!
  37. © 2018, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. https://medium.com/@adhorn
  38. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Amazon Confidential and Trademark © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Thanks you! @adhorn
  39. © 2018, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Health checks with Route 53