-

WG Day:

Menlo Park, California
Back to Schedule

Gary Zeng

The 40,000-field Query: Optimizations for Gigantic High-QPS Operations

Transbay Tube
Production InsightHuge Scale

Session description

Parsing a GraphQL query generally has negligible cost. But what happens your front page query has millions of QPS, 10s of thousands of fields, and there are hundreds of versions of the query? At Meta, we've found that parsing becomes a significant bottle neck under these constraints. In this talk, we dive into server-side optimizations we built to handle persisted documents beyond simple LRU caches. We will cover: - Lazy fragment parsing. We delay parsing a fragment until the executor encounters a spread that matches the fragment's type, using offset maps to jump through the document text. - Traffic based caching. We cache pre-parsed structures taking into consideration CPU savings and memory cost. - Fragment inlining to reduce overhead in the CollectFields step. Attendees leave with deep understanding of performance considerations of GraphQL execution engines. I hope other GraphQL server implementations can consider adopting similar strategies to better serve a larger variety of traffic patterns.


Session speakers

Gary Zeng

Meta, Software Engineer, GraphQL Platform

Huge Scale

Gary is a Software Engineer working on Meta's GraphQL engine powering one of the worlds largest schemas. He focuses the balance between language design and system reliability. In the physical world, Gary has hosted over 1000 hours of Dungeons and Dragons.

Get your ticket

Join two 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