Frodo Baggins but with Federated GraphQL

A presentation at GraphQL Meetup in June 2022 in Prague, Czechia by Jakub Beneš

Slide 1

Slide 1

Frodo Baggins but with Federated GraphQL

Slide 2

Slide 2

Wait, what?

Slide 3

Slide 3

Slide 4

Slide 4

jukben

Slide 5

Slide 5

Jakub Beneš Staff Engineer at Productboard » jukben.codes » @jukben » AMA later

Slide 6

Slide 6

Agenda » GraphQL and why we have chosen it » GraphQL Federation in nutshell » What we did and how we did it

Slide 7

Slide 7

Who knows GraphQL?

Slide 8

Slide 8

Slide 9

Slide 9

GraphQL in 180 seconds

Slide 10

Slide 10

Query language

Slide 11

Slide 11

Strongly typed » Nullable by default » Default scalars: Int, Float, String, Boolean, ID » Enums, Interfaces, Directives » https://spec.graphql.org/

Slide 12

Slide 12

You get what you ask for

Slide 13

Slide 13

Non-breaking changes

Slide 14

Slide 14

DX

Slide 15

Slide 15

Slide 16

Slide 16

Productboard’s Reasons

Slide 17

Slide 17

Slide 18

Slide 18

» YouTube

Slide 19

Slide 19

Federated GraphQL

Slide 20

Slide 20

Slide 21

Slide 21

Slide 22

Slide 22

Apollo Federation » https://www.apollographql.com/docs/federation/ federation-spec » Introduces a few of directives like: @key, @sharable to instruct Gateway how to do query planning.

Slide 23

Slide 23

Query planning

Slide 24

Slide 24

Our Implementation

Slide 25

Slide 25

Frontend

Slide 26

Slide 26

Backend » https://netflix.github.io/dgs/ built on top of Spring Boot » https://graphql-ruby.org » Server needs to follow Federation Spec and Global ID and Pagination spec

Slide 27

Slide 27

Federation » decided to go with managed Federation by Apollo Studio » schema registry with schema checking

Slide 28

Slide 28

Observability: Service

Slide 29

Slide 29

Observability: APM

Slide 30

Slide 30

Observability: Breaking changes

Slide 31

Slide 31

Morphing aka how to roll it out

Slide 32

Slide 32

The Ring

Slide 33

Slide 33

Slide 34

Slide 34

Fellowship @huvik @lukas_krecan @balvajs

Slide 35

Slide 35

Problem and Solution proposal

Slide 36

Slide 36

Transparent (over)communication

Slide 37

Slide 37

Make it fun

Slide 38

Slide 38

Slide 39

Slide 39

In numbers » We started in Q4 2021 » First product use-cases early this year » Now we have 8 subgraphs connected » 33 queries, 38 mutations, 150 types » 500 RPM in peak

Slide 40

Slide 40

Recap » Federated GraphQL is good especially if you want to iterate fast in distributed way » It’s easier to run big thing if you name it » Big changes requires patience

Slide 41

Slide 41

Slide 42

Slide 42

Thank you!

Slide 43

Slide 43

Resources » Pretty Glonky » Apollo Federation » Relay and Relay’s Global ID spec and Relay’s Pagination spec » DGS » GraphQL Ruby » Production Ready GraphQL