$30 off During Our Annual Pro Sale. View Details »

Behind GraphQL: A first principles approach

Behind GraphQL: A first principles approach

Designing GraphQL API's for scale is a challenging and exciting process. Although an extremely new technology GraphQL builds on system architecture patterns that have been around for a long time in different flavors.

Bogdan Nedelcu

October 10, 2019
Tweet

More Decks by Bogdan Nedelcu

Other Decks in Programming

Transcript

  1. @bogdanned github.com/bogdanned
    1
    System Design and Architecture

    @GraphQL

    View Slide

  2. @bogdanned github.com/bogdanned
    2
    –The GraphQL Website
    “GraphQL is a query language for your API, and a
    server-side runtime for executing queries by
    using a type system you define for your data.”

    View Slide

  3. @bogdanned github.com/bogdanned
    GraphQL influences our architecture uniquely,
    yet it builds on well known design patterns.
    3

    View Slide

  4. @bogdanned github.com/bogdanned
    - Api Gateway
    - Integration Database
    - Data Federation
    - Backend for Front End
    The Usual Suspects

    View Slide

  5. @bogdanned github.com/bogdanned
    API Gateway
    5

    View Slide

  6. @bogdanned github.com/bogdanned
    6
    - service client coupling
    - many round trips
    - redundant edge functions

    View Slide

  7. @bogdanned github.com/bogdanned
    7

    View Slide

  8. @bogdanned github.com/bogdanned
    8
    - client specific API
    - request routing
    - API composition
    - unique edge functions

    View Slide

  9. @bogdanned github.com/bogdanned
    9
    - unique point of failure
    - development bottleneck
    - rollout strategy

    View Slide

  10. @bogdanned github.com/bogdanned
    The Integrated Database
    10

    View Slide

  11. @bogdanned github.com/bogdanned
    11
    - immediate synchronisation
    - no integration layer
    - faster rollout

    View Slide

  12. @bogdanned github.com/bogdanned
    12
    - Bounded Context Violation
    - complexity in development
    - deep client coupling

    View Slide

  13. @bogdanned github.com/bogdanned
    13
    Which amount?

    View Slide

  14. @bogdanned github.com/bogdanned
    14
    – Martin Fowler, Database Styles 2004
    “The resulting links between applications and
    databases end up being brittle and thus difficult
    to change.”

    View Slide

  15. @bogdanned github.com/bogdanned
    The Data Federation Pattern
    15

    View Slide

  16. @bogdanned github.com/bogdanned
    16

    View Slide

  17. @bogdanned github.com/bogdanned
    - different heterogeneous data sources
    - uniform consumer interface
    - improved governance
    - unique business domain mapping
    17

    View Slide

  18. @bogdanned github.com/bogdanned
    - difficult requirement reconciliation
    - non trivial merging strategies
    - need of more generic data structures
    18

    View Slide

  19. @bogdanned github.com/bogdanned
    19
    Apollo Federation
    - separation of concerns
    - graph orchestration
    - sophisticated tooling

    View Slide

  20. @bogdanned github.com/bogdanned
    20
    – Phil Calcado, Some thoughts on GraphQL vs. BFF 2019
    “ .. it is hard for me to believe that you can
    combine the needs of many different
    applications, owned by different teams, with
    different users and use cases, in a single
    schema”

    View Slide

  21. @bogdanned github.com/bogdanned
    Backend For Frontend
    21

    View Slide

  22. @bogdanned github.com/bogdanned
    22

    View Slide

  23. @bogdanned github.com/bogdanned
    23
    Thank @you !

    View Slide

  24. @bogdanned github.com/bogdanned
    24
    #discussion

    View Slide