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

Going Global With Serverless - Builders' Day Lo...

Going Global With Serverless - Builders' Day London 2019

Going Global With Serverless as presented at Builders' Day London 2019

Julio Faerman

March 04, 2019
Tweet

More Decks by Julio Faerman

Other Decks in Technology

Transcript

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

    rights reserved. Julio Faerman @faermanj Building Global Services with Serverless! Adrian Hornsby @adhorn
  2. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Global infrastructure for global applications
  3. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Availability Fundamentals
  4. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Availability in parallel A = 1 – (1 – Ax)2 Part X Part X
  5. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Availability in parallel Component Availability Downtime X 99% (2-nines) 3 days 15 hours Two X in parallel 99.99% (4-nines) 52 minutes Three X in parallel 99.9999% (6-nines) 31 seconds
  6. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Component redundancy increases availability significantly!
  7. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. AWS Global Infrastructure
  8. © 2019, 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
  9. © 2019, 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
  10. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Multi-Region Architecture 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
  11. © 2019, Amazon Web Services, Inc. or its affiliates. All

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

    rights reserved. Why serverless components?? No provisioning, no management Pay for value Fault Tolerant and Automatic scaling Highly available and secure
  13. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. AWS operational responsibility models On-Premises Cloud Less More Compute Virtual Machine EC2 Elastic Beanstalk AWS Lambda Fargate Databases MySQL MySQL on EC2 RDS MySQL RDS Aurora Aurora Serverless DynamoDB Storage Storage S3 Messaging ESBs Amazon MQ Kinesis SQS / SNS Analytics Hadoop Hadoop on EC2 EMR Elasticsearch Service Athena
  14. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Why build a multi-region active-active architecture?
  15. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Improve latency for end-users ~300ms ~140ms
  16. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Recover from failures 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
  17. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Building a multi-region architecture.
  18. © 2019, 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 or get isolated. Distributed System In the presence of a network partition, you must choose between consistency and availability!
  19. © 2019, Amazon Web Services, Inc. or its affiliates. All

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

    rights reserved. Amazon Global Network
  21. © 2019, 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
  22. © 2019, Amazon Web Services, Inc. or its affiliates. All

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

    rights reserved. Traffic Management
  24. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Global routing with Route 53
  25. © 2019, Amazon Web Services, Inc. or its affiliates. All

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

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

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

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

    rights reserved. AWS Global Accelerator
  30. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Global Accelerator Application Load Balancer Lambda Function DynamoDB Global Table Route 53 Latency Routing API Gateway Regional API Lambda Function DynamoDB Global Table
  31. © 2019, Amazon Web Services, Inc. or its affiliates. All

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

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

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

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

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

    rights reserved. Route53: Traffic Policy
  37. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Health checks with Route 53
  38. © 2019, 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à!
  39. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Region eu-central-1 Region eu-west-2 Global Table 2x Anycast IPs Global Accelerator
  40. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Region eu-central-1 Region eu-west-2 Global Table
  41. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Region eu-central-1 Region eu-west-2 Global Table
  42. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Region eu-central-1 Region eu-west-2 Global Table
  43. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Region eu-central-1 Region eu-west-2 Global Table 2x Anycast IPs Global Accelerator Voilà!
  44. © 2019, Amazon Web Services, Inc. or its affiliates. All

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

    rights reserved. Thank you! Julio Faerman @faermanj Adrian Hornsby @adhorn