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

Concevoir une architecture mondiale et redondante sur plusieurs régions. (slides in English)

Concevoir une architecture mondiale et redondante sur plusieurs régions. (slides in English)

Concevoir une architecture mondiale et redondante sur plusieurs régions.
 
Vous déployez souvent des applications pour les rendre disponibles à vos clients partout dans le monde en déployant vos services sur plusieurs régions? Ces projets complexes nécessitaient souvent des mois d’ingénierie, mais le serverless a changé le jeu ! Cette présentation vous aidera à comprendre comment créer des applications serverless multi-régions et actif-actif. Découvrez les avantages et les inconvénients du routage DNS par rapport à Anycast IP et apprenez comment exploiter des services serverless tels que Route 53, Global Accelerator, API Gateway, l'Application Load Balancer, AWS Lambda et DynamoDB.

Adrian Hornsby

April 02, 2019
Tweet

More Decks by Adrian Hornsby

Other Decks in Programming

Transcript

  1. S U M M I T
    P a ri s

    View Slide

  2. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T
    Concevoir une architecture mondiale et
    redondante sur plusieurs régions.
    Adrian Hornsby
    Sr. Technical Evangelist
    Amazon Web Services
    Joris Andrade
    Software Engineer
    FrontApp
    @Zambka
    N E T 3 0 2

    View Slide

  3. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T
    Why build a multi-region architecture?

    View Slide

  4. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T
    Once upon a time …
    Origin

    View Slide

  5. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T
    And Now …
    Origin

    View Slide

  6. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T
    And Now …
    Origin
    ~300ms

    View Slide

  7. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T
    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

    View Slide

  8. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T
    Serverless cost model is a huge advantage here!

    View Slide

  9. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T
    Active-Active | Active-Passive | What to do?

    View Slide

  10. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T
    Amazon Global Network

    View Slide

  11. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T
    Origin
    Cross region VPC peering
    Origin

    View Slide

  12. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T
    Amazon S3 cross-region replication
    Bucket with
    objects
    Bucket with
    objects

    View Slide

  13. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T
    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

    View Slide

  14. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

    View Slide

  15. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Setup

    View Slide

  16. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T
    Multi-region with
    Route 53

    View Slide

  17. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T
    Latency based routing
    Region
    Region
    Application Application

    View Slide

  18. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T
    Geo-based routing
    Region us-east-1
    Region us-west-2
    Application Application

    View Slide

  19. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T
    Weighted round robin routing
    Region us-east-1
    Region us-west-2
    Application Application

    View Slide

  20. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T
    DNS failover
    Region us-east-1
    Region us-west-2
    Application Application

    View Slide

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

    View Slide

  22. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T
    Region us-east-1
    Region us-west-2
    Global Table

    View Slide

  23. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T
    Region us-east-1
    Region us-west-2
    Global Table

    View Slide

  24. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T

    View Slide

  25. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T
    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

    View Slide

  26. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T
    Region us-east-1
    Region us-west-2
    Global Table

    View Slide

  27. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T
    Route53: Traffic Policy

    View Slide

  28. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T
    Health checks with Route 53

    View Slide

  29. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T
    Region us-east-1
    Region us-west-2
    Global Table
    https://globalddb.adhorn.me
    Voilà!

    View Slide

  30. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Setup with

    View Slide

  31. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T
    Amazon CloudFront AWS Lambda
    [email protected]
    [email protected]

    View Slide

  32. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T
    [email protected] Events
    CloudFront
    cache
    Viewer Response Origin Response
    Origin
    Origin Request
    Viewer
    Viewer Request

    View Slide

  33. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T
    Write Once, Run Lambda Functions Globally
    N Virginia
    AWS Location
    AWS Location
    AWS Location
    AWS Location
    AWS Location
    AWS Location

    View Slide

  34. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T
    [email protected] 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);
    }

    View Slide

  35. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

    View Slide

  36. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T
    #awssummit
    Joris Andrade
    Software Engineer
    FrontApp
    @Zambka

    View Slide

  37. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T
    #awssummit

    View Slide

  38. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T
    #awssummit
    Move to AWS
    Managed Services Infra as Code
    1st Infra
    engineer
    Multi-
    region
    Horizontal
    sharding
    Kubernete
    s
    Lambda
    @Edge

    View Slide

  39. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T
    #awssummit
    Multi-region setup
    • Data from a customer in only 1 region
    • US-West-1 ! / EU-West-1 "
    • Dynamic routing with DynamoDB
    • VPC Peering

    View Slide

  40. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T
    #awssummit
    Multi-region Setup

    View Slide

  41. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T
    #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.

    View Slide

  42. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T
    #awssummit
    Reduce latency for
    global teams

    View Slide

  43. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Lambda @ Edge

    View Slide

  44. Live Demo

    View Slide

  45. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T
    #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

    View Slide

  46. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T
    #awssummit
    Takeaways
    Easy to scale: around 300 run / s at peak time
    Complex to deploy, test and monitor

    View Slide

  47. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Setup

    View Slide

  48. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T
    AWS Global Accelerator

    View Slide

  49. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T

    View Slide

  50. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T
    Region eu-central-1
    Region eu-west-2
    Global Table
    2x Anycast IPs
    Global
    Accelerator

    View Slide

  51. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T
    Region eu-central-1
    Region eu-west-2
    Global Table

    View Slide

  52. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T

    View Slide

  53. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T
    Region eu-central-1
    Region eu-west-2
    Global Table

    View Slide

  54. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T

    View Slide

  55. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T

    View Slide

  56. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T

    View Slide

  57. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T
    Region eu-central-1
    Region eu-west-2
    Global Table

    View Slide

  58. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T

    View Slide

  59. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T

    View Slide

  60. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T

    View Slide

  61. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T

    View Slide

  62. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T

    View Slide

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

    View Slide

  64. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

    View Slide

  65. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T
    DNS Issues

    View Slide

  66. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    S U M M I T
    https://medium.com/@adhorn

    View Slide

  67. Thank you!
    S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Adrian Hornsby

    View Slide