Netflix share how avoid these GraphQL pitfalls - Stephen Spalding

Published: 09 March 2023
on channel: Apollo GraphQL
2,916
57

Watch the unedited GraphQL Summit 2022 talks here: https://bit.ly/3DNPK7J

Having made a bet on GraphQL Federation 3 years ago, Netflix know a thing or two about the potential pitfalls. Stephen Spalding walks us through a couple of these pitfalls, which he calls Microservice Madness and Schema Anarchy.

To avoid Microservice Madness, Stephen suggests approaching your graph in a similar way to the nutritional advice, "Eat food. Not too much. Mostly plants."

'Use Federation.' For a very few a monolith might work well for you, but for the rest of us (particularly with multiple teams contributing to the same API) federation is a much needed solution.
'Not too much.' Be thoughtful about how you break up microservices. If you have more services than you do teams, it is worth while to step back and ask 'why?'
'Mostly along team boundaries.' The supergraph is a technical solution to a people problem. At Netflix, federation is a way to break out services incrementally as they grow, by teams, without breaking the contract with clients.

Taking on Schema Anarchy, Stephen offers up some great tips including creating a schema working group, documenting your schema best practices, systemizing and democratizing schema update proposals, and finally using linting to give your teams more space and time to make the important human decisions.

You don't have to crank Federation up to 11 straight out of the gate, advises Stephen. Start simple and crank it up as you go. Use Federation. Not too much. Mostly along team boundaries.