-

Amsterdam, Netherlands
Back to Schedule

Aileen Chen

From Data Loaders To Batch Resolvers

IJzaal
Developer ExperienceIntermediateBackend

Session description

In theory, data loaders solve most "N+1" problems in GraphQL. In practice, they can be hard to implement, so they’re typically used only in performance-critical situations and often reactively, once inefficiencies surface. To achieve better performance, batching needs to be applied wherever possible. This talk introduces batch resolvers, a more developer-friendly alternative to data loaders. While traditional GraphQL resolvers take a single input and produce a single output, batching resolvers take a list of inputs and return a list of outputs. A batch resolver can simply call a batch service API without worrying about data loaders. When a developer provides a batch resolver, our GraphQL server automatically aggregates individual data fetches into a single call to that resolver. It can also apply heuristics to improve aggregation, for example by consolidating different selection sets for the same entity into a single input. This design not only makes application developers’ lives easier, but also allows the server to better optimize query execution by coordinating batch dispatching as part of a broader execution strategy.


Session speakers

Aileen Chen

Airbnb, Staff Software Engineer

Backend

I work on Viaduct, Airbnb's GraphQL-based data-oriented service mesh.

Get your ticket

Join three transformative days of expert insights and innovation to shape the next decade of APIs!

Get tickets
COMMUNITYDEVELOPER EXPERIENCEAPIsTOOLS & LIBRARIESCOMMUNITYDEVELOPER EXPERIENCEAPIsTOOLS & LIBRARIES
OPEN SOURCEFEDERATIONECOSYSTEMSTRACING & OBSERVABILITYOPEN SOURCEFEDERATIONECOSYSTEMSTRACING & OBSERVABILITY
BEST PRACTICESWORKSHOPSSCHEMASSECURITYBEST PRACTICESWORKSHOPSSCHEMASSECURITY