News

Netflix Open Sources GraphQL for Spring Boot

Netflix has open sourced its Domain Graph Service (DGS) framework, which the content streaming service developed to simplify the implementation of GraphQL, for standalone and federated GraphQL services.

"By open-sourcing the project, we hope to contribute to the Java and GraphQL communities and learn from, and collaborate with, everyone who will be using the framework to make it even better in the future," wrote Netflix software engineers Paul Bakker and Kavitha Srinivasan, in a blog post.

Originally developed internally by Facebook, GraphQL is an open-source query language for APIs and a server-side runtime for executing queries with existing data. As the GraphQL Foundation explains it, the language "… provides an alternative to REST-based architectures with the purpose of increasing developer productivity and minimizing amounts of data transferred."

GraphQL is used in production by a wide range of organizations including Credit Karma, GitHub, Intuit, PayPal, and the New York Times, among others. Netflix uses it as its data query and manipulation language to pull data into systems that support its content engineering group, the company says.

In 2019 Netflix began implementing a federated GraphQL architecture, the bloggers explained, which meant that many of the company's backend teams needed to adopt GraphQL in its Java ecosystem. Netflix has standardized on the Spring Boot rapid application development framework for backend development. To make this new federated architecture a success, and because the company's framework was created on top of Spring Boot, Netflix needed to enable "a great developer experience" for GraphQL in Spring Boot.

"This framework was initially intended to be internal only," the bloggers wrote, "focusing on integration with the Netflix ecosystem for tracing, logging, metrics, etc. However, proper modularization of the framework was always top of mind. It became apparent that much of the framework we had built was not actually Netflix specific. The framework was mostly just an easier way to build GraphQL services, both standalone and federated."

Spring Boot was designed to simplify the development of stand-alone, production-grade, Spring-framework-based apps that run with little Spring configuration. Spring Boot is "opinionated" out of the box, so it encourages specific practices to increase ease of development. Spring Boot 2.0, the first major revision since Spring 1.0, which was released almost five years ago, was released in March 2018.  It was the result of 17 months of work and over 6,800 commits by 215 different individuals, said Spring Framework committer Phil Webb at the time. in a blog post. It was also, the first GA version of Spring Boot to provide support for Spring Framework 5.0.

The Spring Framework continues to be one of the most popular programming and configuration models for building modern Java-based enterprise applications on any type of deployment platform. It's an open-source, layered Java/J2EE framework based on code published in SpringSource founder Rod Johnson's book Expert One-on-One Java EE Design and Development (Wrox Press, October 2002).

The blog post lists the key features of the DGS Framework, along with details for implementation and a bit more about the history of the project.

About the Author

John K. Waters is the editor in chief of a number of Converge360.com sites, with a focus on high-end development, AI and future tech. He's been writing about cutting-edge technologies and culture of Silicon Valley for more than two decades, and he's written more than a dozen books. He also co-scripted the documentary film Silicon Valley: A 100 Year Renaissance, which aired on PBS.  He can be reached at [email protected].