Netflix's Actual Path
Two Graphs, Two Starting Points
| Studio Edge (internal tools) | Consumer apps (iOS & Android) | |
|---|---|---|
| Starting shape | Studio API: one curated GraphQL graph, owned and implemented by one team | A Falcor API monolith. One API team maintained both the Java Falcor implementation and the API server |
| Stated pain | The graph team was far from domain expertise. Wiring in new back-ends was manual. One small team carried all ops and support | "A logic-heavy monolith with over a decade of tech debt". The legacy Falcor API was not meant to "linger forever" |
| First step | Studio API became the first DGS. New DGSs were exposed alongside it | A GraphQL shim on top of Falcor, so client teams could move before any server-side work |
| How safety was checked | Not published in detail (schema-registry checks, see below) | Phase 1: AB test. Phase 2: Replay Testing and Sticky Canaries |
| Dates | Early 2019 design → first apps end of 2019 → self-service April 2020 → 70 DGSs by Nov 2020 | Shim from summer 2020 → mobile home canvas at 100% within 6 months → Phase 2 completed in 2022 |
Studio Edge: From a GraphQL Monolith to Domain Graph Services
The source is the two-part post "How Netflix Scales its API with GraphQL Federation" by Tejas Shikhare (Part 1, 9 Nov 2020; Part 2, 11 Dec 2020). Before Studio API existed, Studio teams used two workarounds. Some built single-use aggregation layers, either as UI-owned BFFs or as mid-tier services. Others built materialized views of other teams' data. Studio API fixed the consistency problem, because "every field in GraphQL resolves to a single piece of data-fetching code". It then became the bottleneck. Netflix's framing: "unified but decoupled, curated but fast moving." Apollo published the Federation spec in early 2019, Netflix ran a test implementation, and the next architecture, Studio Edge, had three components:
| Domain Graph Service (DGS) | A spec-compliant GraphQL service owned by a domain team. The team either converts an existing microservice or starts a new one. |
|---|---|
| Schema Registry | Built in-house in Kotlin. Schema changes are event-sourced on Cassandra, which powers a Schema History view. Integrated with Spinnaker. |
| GraphQL Gateway | "Based on Apollo's reference implementation and is written in Kotlin". Coroutines handle parallel fetches. |
A DGS schema push is checked into the registry only if three checks pass: the schema is valid GraphQL, it composes with every other DGS schema, and it is backwards compatible. Removal goes through a deprecation workflow. Netflix tracks usage for every field and makes the breaking change only once stats show nobody queries the deprecated field (see Schema governance). Part 1 gives the one performance number: query planning and execution add "~10ms overhead in the worst case", including building the plan, deserializing DGS responses and serializing the merged response. At QCon SF 2022, Shikhare gave a similar budget: "shouldn't be spending more than 5 to 10 milliseconds doing any of the GraphQL stuff" ("Scaling GraphQL Adoption at Netflix").
Part 2 is the more useful half for this guide, because it shows where the BFF's jobs went:
- Payload shaping went into the schema. "UI developers should not have to build Backends For Frontends (BFF) to massage the data for their needs, rather, they should help shape the schema". A schema working group reviewed changes, with more rigor for core federated types. Netflix designed the schema first on purpose, rather than generating it from the Protobuf models behind its gRPC APIs.
- Authorization moved from the BFFs to the DGS owners. Before, "some teams implemented authorization in their BFFs, some in microservices, and others did both". Afterwards each resolver is annotated with
@Secured, so the same user gets the same answer for the same data whichever UI asks. (The Where the BFF's jobs go part picks this up.) - The gateway was made narrow on purpose. Netflix gave it five principles: it has a single purpose (parse, plan, execute), it is stateless, it is demand-controlled (callers are rate-limited, and a static query cost is computed so expensive queries are rejected), it runs in multiple regions, and it is sharded by functionality, with a separate fleet for long-lived Subscriptions. The gateway polled the registry for schema, and Netflix said it was moving the federation config into a versioned S3 bucket so a registry outage would not take the gateway down. That is the blast-radius argument The Operating the gateway part builds on.
The DGS Framework
Each backend team needed to write a GraphQL service on Netflix's Java stack. So the Developer Experience team built the DGS Framework on graphql-java and Spring Boot and open-sourced it in February 2021 ("Open Sourcing the Netflix Domain Graph Service Framework: GraphQL for Spring Boot"). It provides an annotation-based programming model (@DgsComponent, @DgsQuery, @DgsData, and @DgsEntityFetcher for the federation _entities reference resolver), code generation from the schema, DataLoader integration, and hooks into Netflix's tracing, metrics, logging and auth. The framework has since integrated Spring for GraphQL underneath (DGS docs), but the DGS programming model is unchanged. The framework matters to the migration story because each domain team had to pick up GraphQL expertise it had never needed before. The DGS framework and Netflix's internal training were how Netflix lowered that cost. Part 2 is candid that "batching & lookahead" and entity resolvers are "not trivial".
The Consumer Migration: Falcor → Shim → Video API
Part 2 ends by saying Netflix had "prototyped using GraphQL Federation for the Netflix consumer app search page on iOS & Android" with three DGSs and a small subset of users. The full account is "Migrating Netflix to GraphQL Safely" (Jennifer Shin, Tejas Shikhare, Will Emmanuel; 14 June 2023). It describes a 2022 migration of the iOS and Android apps, "a total overhaul from the client to the API layer", with zero downtime:
- Phase 1: shim (from summer 2020). Netflix put a GraphQL shim service on top of the existing Falcor API. The goal was to unblock client engineers, who could now work on "cache normalization, experiment with different GraphQL clients, and investigate client performance without being blocked by server-side migrations." Shikhare's description of the shim in the InfoQ podcast (Jan 2023): "we mapped the data fetchers for GraphQL data fetchers to call the Falcor routes." To validate it, Netflix ran a client-side AB test, Falcor versus GraphQL, over two groups totalling 1 million users. It compared error rates, latency and time-to-render. The results "hinted that GraphQL's correctness was not up to par". Months of fixes followed, covering cache TTLs and flawed client assumptions, before the mobile homepage canvas reached 100% GraphQL within 6 months.
- Phase 2: reimplement the Falcor logic in a GraphQL-first Video API service. The swap happened field by field inside the federation. The Video API service declared the same field as the shim (the post's example is
certificationRating) and marked it@override, so the gateway routed that field to the new service. The post does not say whether Netflix used Apollo's labelled progressive override; it predates that feature (Federation 2.7, February 2024). Netflix controlled the traffic split in its infrastructure instead, as the Sticky Canary below shows.
Netflix used different tests for different risks. It chose among them using two criteria: whether the requirement was functional or non-functional, and whether the request was idempotent.
| Tool | What it checks | What it cannot check |
|---|---|---|
| AB test (Phase 1) | Coarse QoE across a 1M-user split. Proved the client-side GraphQL stack | Diagnosis. The metrics pointed at problems but not at the field responsible |
| Replay Testing (Phase 2) | Samples live traffic from Mantis and runs the identical query against the shim and against Video API, then diffs the payloads as flattened JSON paths | PII (excluded on purpose), non-idempotent fields, caching, logging, and any field nobody thought to include in the replayed queries |
| Sticky Canary (Phase 2) | Two gateway clusters, one with the old schema (all fields to the shim) and one with the new schema (fields to Video API). Zuul assigns each customer to one cluster for the whole experiment "based on their device and profile, similar to a bucket hash". Netflix watched latency, error rates, resource use, device QoE and streaming health | Long-lived effects (use a full AB test for those). It also hits real users, so it relied on automatic real-time cancellation |
The replay diffs look like /data/videos/0/tags/3/id: (81496962, null), with the control value on the left and the experiment on the right. They caught missing data caused by "over-eager timeouts", encoding differences, localization, date precision and floating-point accuracy. The post also admits that correctness itself got fuzzy: "is it more correct for an array to be empty or null, or is it just noise?" Netflix's answer was to match existing behaviour, because nobody could verify client error handling. Sticky canaries started with tiny allocations for hour-long runs and grew to multi-region runs of 12 hours or a day. Note the level at which the canary switched: whole gateway clusters with different schemas, not a per-field percentage. The migration playbook part turns that into a playbook.
What Netflix Has Published, and What It Hasn't
| Question | Status |
|---|---|
| Why federate? | Published, and organisational. The aggregation layer "has become increasingly harder" to develop as developer count and domain complexity grew. None of the posts claims the gateway deduplicates entity fetches or reduces fan-out. The only performance claim is the ~10 ms overhead cost. The Netflix-guide idea that "the gateway fetches member 42 once" is tested in the query planner part, not by Netflix. |
| Did the TV app migrate? | Not published. The 2023 post covers iOS and Android. The QCon 2022 talk names the "discovery UI" (200M+ members) and iOS/Android teams. This guide's TV home page example is a reasoned case, not Netflix's documented one. |
| What happened to the BFFs? | Two Netflix voices. Paul Bakker (QCon SF 2023, "How Netflix Really Uses Java"): "We don't need a backend for frontend anymore because … of field selection". Shikhare (QCon SF 2022): "The BFF don't just go away. The logic either moves into the client, or it moves into the server." The second quote is the thesis of the Where the BFF's jobs go part. |
| Scale today | QCon SF 2022 (talk figures, not a post): over a billion requests a day, tens of thousands of types and fields, 500+ active developers, three graphs (consumer, Studio, internal tools). Apollo's 2024 write-up puts Studio Edge at about 150 subgraphs and 3,000+ types. Tooling mentioned: GraphHub (schema monorepo) and GraphDoctor (a schema linter on every PR). |
| Does the gateway still run on Apollo's reference planner? | Not published since 2020. What is on record is "Kotlin, based on Apollo's reference implementation" (Part 2). |
The Invariants
- Guarantees: Netflix's published path changed one variable at a time. First the client protocol behind a shim, tested by an AB test. Then the implementation, one field at a time behind
@override, tested by replay diffs for idempotent data and sticky canaries for behaviour. Every schema push had to be valid, composable and backwards compatible before the gateway saw it. - Does not guarantee: That the consumer graph is split into entity-owned subgraphs (the published end state is one Video API service). That the TV app follows the same path. That entity fetches are deduplicated (Netflix never claims it). That replay testing covered PII, mutations, caching, or any field left out of the replayed queries.