Crossing Domain Boundaries with GraphQL

5f81e2d2889d7642fd84c8b24db7ee17?s=47 DamirSvrtan
September 05, 2019

Crossing Domain Boundaries with GraphQL

How is it like to be an API consumer and an API provider at the same time? How is building an orchestration layer for distributed data different than building an API backed by a single database? When building an app that goes across many domains, when is the time to sync data and when is it okay to proxy? How to deal with downstream failures and communicate that efficiently to our customers? The Netflix Studio often builds orchestration layers to tackle and abstract a lot of the complexities that are behind various micro services - let’s see how GraphQL fits perfectly into that story and helps making those layers a better experience for developers on both sides of the API.

5f81e2d2889d7642fd84c8b24db7ee17?s=128

DamirSvrtan

September 05, 2019
Tweet

Transcript

  1. CROSSING DOMAIN BOUNDARIES with GraphQL

  2. THE DVD RENTAL COMPANY

  3. VIDEO ON DEMAND

  4. ORIGINAL CONTENT

  5. BIG SHIFT?

  6. OLD INDUSTRY

  7. REMEMBER THESE?

  8. PROBLEM SPACE

  9. Studio apps

  10. STARTING WITH A MONOLITH

  11. SPECIALIZATION

  12. STARTING fresh

  13. MASH OF EXISTING & NEW DATA

  14. SINGLE DATA SOURCE

  15. UI TALKS TO MULTIPLE APIS?

  16. UI TALKS TO MULTIPLE POLYGLOT APIS?

  17. SEEMS LIKE TROUBLE

  18. ORCHESTRATION LAYER

  19. API TECH?

  20. API Requirements

  21. STOP OVERFETCHING

  22. EFFICIENT RELATIONSHIP FETCHING

  23. HANDLE COMPLEX RELATIONSHIPS

  24. GOING FORWARD with GraphQL

  25. ORCHESTRATING WITH GRAPHQL

  26. INITIAL HICCUPS

  27. query { production(id: $productionID) { title logline dates(...) { startDate

    endDate } talent(...) { firstName lastName } shootingLocations { address latitude longitude } } }
  28. EASY INTROSPECTION

  29. DOCUMENTATION AS A FIRST CLASS CITIZEN

  30. THE POLYGLOT ORCHESTRATION LAYER

  31. API CLIENTS

  32. HANDWRITTEN API CLIENTS

  33. AUTOGENERATED API CLIENTS

  34. AUTOGENERATED API CLIENTS SWAGGER CODE GENERATOR GRPC JSON API SPEC

  35. NETFLIX ECOSYSTEM CHANGES FAST!

  36. PRODUCTION - SEASON RELATIONSHIP

  37. DEPRECATION API

  38. PARTIAL DATA RESPONSES

  39. MICROSERVICES WILL FAIL!

  40. PARTIAL DATA LOAD { "data":{ "productions":[ { "title": "Stranger Things

    S03", "dates": "...", "shootingLocations": [] } ] }, "errors":[ { "message":"Unable to load shooting location data", "extensions":{ "error_type":"PARTIAL_LOAD_ERROR" } } ] }
  41. OPT-IN, NOT OPT-OUT

  42. NO KNIGHTS IN SHINING ARMORS

  43. "FETCH ALL AT ONCE" FALLACY

  44. LAZY LOADING STILL APPLIES

  45. WHAT THE future holds ...

  46. DUPLICATED EFFORTS

  47. UNIFIED STUDIO GRAPH

  48. GRAPHQL FEDERATION

  49. Conclusion

  50. DAMIR SVRTAN TWITTER: @DAMIRSVRTAN