Introducing Netflix’s Open‑Source Domain Graph Service (DGS) Framework for Spring Boot
The article presents Netflix’s open‑source Domain Graph Service (DGS) framework, detailing its purpose, core features, schema‑first development approach, practical usage examples, integration with the GraphQL ecosystem, support for federation, modular architecture, distributed tracing, and how developers can get started with the project.
Netflix has open‑sourced its Domain Graph Service (DGS) framework, which simplifies the implementation of both standalone and federated GraphQL services on the Java ecosystem, especially Spring Boot.
The framework offers annotation‑based Spring Boot programming model, a testing framework for query unit tests, a Gradle code‑generation plugin for Java/Kotlin types, seamless integration with GraphQL Federation, Spring Security, GraphQL subscriptions (WebSockets and SSE), file uploads, error handling, automatic support for interface/union types, a Java‑centric GraphQL client, and pluggable instrumentation.
1. Why DGS is needed – Netflix needed a unified developer experience for GraphQL across many backend teams, building on Spring Boot and graphql‑java, while keeping the framework modular and reusable beyond internal use.
2. Schema‑first development – The framework supports both schema‑first and code‑first approaches, with a strong preference for schema‑first to improve developer experience, tooling, and clear schema evolution in a federated environment.
3. Practical usage – A simple example shows how to define a schema, implement data fetchers using @DgsData and @InputArgument annotations, and run the service with the built‑in GraphiQL UI, highlighting testing support that mirrors standard JUnit tests.
4. Integration with the GraphQL ecosystem – DGS works with popular tools such as graphql‑kotlin (code‑first), graphql‑java (schema‑first), and graphql‑java‑kickstart, providing a straightforward way to build GraphQL services in both Java and Kotlin.
5. Federation support – The framework enables easy creation of federated services using Apollo’s @extends directive, allowing services to extend shared types and resolve _entities queries.
6. Architecture – DGS is built as modular Spring Boot extensions, compatible with Java 8, and integrates Netflix’s internal infrastructure for tracing, metrics, and logging while remaining open source.
7. Distributed tracing and metrics – Although the proprietary tracing and metrics components are not open‑sourced, DGS can integrate with them and also supports custom Instrumentation via the graphql‑java API.
8. Getting started – Developers can follow the documentation and tutorials on the DGS website, contribute via the GitHub repository, and use the Gradle code‑generation plugin for Java/Kotlin type generation.
9. Team acknowledgments – The success of DGS at Netflix is credited to the BFG team and the broader community of contributors.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Top Architect
Top Architect focuses on sharing practical architecture knowledge, covering enterprise, system, website, large‑scale distributed, and high‑availability architectures, plus architecture adjustments using internet technologies. We welcome idea‑driven, sharing‑oriented architects to exchange and learn together.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
