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

API Gateways - Dealing with Distributed Backends

Allan Chua
November 21, 2018

API Gateways - Dealing with Distributed Backends

The presentation aims to showcase how API gateways solves the issues associated with distributed back-ends (Microservices and APIs) from a front-end developer's point of view.

Allan Chua

November 21, 2018
Tweet

More Decks by Allan Chua

Other Decks in Programming

Transcript

  1. Dealing with Distributed
    Backends using API Gateways

    View Slide

  2. About Me
    Software Architecture
    Advocate
    Camera Man @
    Engineers.SG
    Polyglot Developer https://www.pogsdotnet.com

    View Slide

  3. Author of API Gateway in a Nutshell
    https://bit.ly/2O4IbAU https://bit.ly/2Dpq44B

    View Slide

  4. Free E-Books
    https://www.microsoft.com/net/learn/dotnet/architecture-guides

    View Slide

  5. Resources

    View Slide

  6. Table of Contents
    I. Abstract
    II. What are API Gateways?
    III. Benefits
    IV. Implementations, Tools and Frameworks
    V. Demo
    VI. Things to Consider

    View Slide

  7. View Slide

  8. View Slide

  9. Microservices

    View Slide

  10. Microservices Pros
    Independent Pieces Independent Teams Independent Releases

    View Slide

  11. How a client app communicates with distributed backend APIs.
    Web API
    Ledger
    Web API
    Catalog
    Web API
    Authentication

    View Slide

  12. Dealing with Microservice APIs
    as a frontend developer
    is apparently HARD

    View Slide

  13. Multiple Point of Contacts
    ????
    ????
    ????
    ????
    Distributed API Challenges

    View Slide

  14. Multiple Point of Attacks
    Distributed API Challenges

    View Slide

  15. Authentication Issues
    JWT Token A
    JWT Token B
    JWT Token C
    Cookies Against
    N Servers?
    Distributed API Challenges

    View Slide

  16. CORS, Domain Name and SSL
    Cross Origin Sharing
    is troublesome
    Buy multiple SSL
    Certificates + Domains?
    Distributed API Challenges

    View Slide

  17. Tightly Coupled Client and APIs
    CATALOG
    LEDGER
    CUSTOMERS
    Each team working on
    a bounded context
    will have a hard time
    releasing their changes
    Distributed API Challenges

    View Slide

  18. API Gateway
    Web API
    Transactions
    Web API
    Catalog
    Web API
    Users
    API Gateway

    View Slide

  19. API Gateway vs Reverse Proxy
    API Gateway
    Reverse Proxy
    Authentication
    Caching
    Rate Limiting Logging Response Aggregation

    View Slide

  20. I. Sub-Domain Encapsulation
    II. Single Point of Contact
    III. Faster Cross Continental Communication
    IV. Centralized Authentication
    V. Single CORS, Domain Name and SSL
    VI. Added Layer of Security
    VII. Centralized Cross Cutting Concerns
    BENEFITS OF USING AN API GATEWAY

    View Slide

  21. I. Authentication
    II. Logging
    III. Monitoring
    IV. Circuit Breaking
    V. Retries with Jitter
    VI. SSL Termination
    VII. Whitelisting
    VIII. Response Aggregation
    IX. Rate Limiting
    CROSS CUTTING CONCERNS

    View Slide

  22. Define Downstream Services
    Downstream services in the context of API gateways are
    independent backend APIs that you want to aggregate and encapsulate.

    View Slide

  23. Define Public Endpoints
    Expose Public Endpoints. Public endpoints not exposed on the gateway
    Are considered private which introduces a more secured way of aggregating APIs

    View Slide

  24. Define Pipelines Policies
    Pipelines are an ordered list of policies that are executed for requests received from all linked apiEndpoints.

    View Slide

  25. Implementation Choices
    CODE
    Generic
    Software
    Cloud
    Management
    Platform
    Code / Config
    Hybrid

    View Slide

  26. Azure API
    Management
    AWS API Gateway Kong
    NGINX API Gateway
    Express API Gateway Ocelot API
    Gateway
    Spring Cloud Gateway
    JHipster

    View Slide

  27. NOT A SILVER BULLET
    Additional
    Development Cost
    Adds Little
    Communication Latency
    Highly Matured
    Team to Operate

    View Slide

  28. Configuration Monolith
    Web API
    Ledger
    Web API
    Catalog
    Web API
    Authentication
    API Gateway

    View Slide

  29. Consider Backends for Frontends (BFF)
    Web API
    Ledger
    Web API
    Catalog
    Web API
    Authentication
    API Gateway
    API Gateway
    Desktop Gateway
    Mobile Gateway

    View Slide

  30. Question and Answers

    View Slide

  31. Resources
    Speaker Deck: https://bit.ly/2FvBzZa
    Github Demo: https://bit.ly/2Q6CNhM
    API Gateway Articles: https://bit.ly/2O4IbAU

    View Slide