Netflix TechBlog | Medium
Follow
How and Why Netflix Built a Real-Time Distributed Graph: Part 3 — Querying the graph with gRPC…
Netflix built a Real-Time Distributed Graph to power real-time insights for their internal partners, and the third part of this blog series focuses on querying the graph efficiently. The graph is a complex network of billions of nodes and edges, and querying it requires a fast and flexible serving layer. The authors discuss the challenges of querying the graph, including handling a wide range of access patterns and supporting both shallow-wide and deep-narrow queries. They explain how they designed a serving layer to efficiently query the graph, using a breadth-first approach and asynchronous composition to minimize latency. The authors also discuss the importance of caching, opt-in enrichments, and eventual consistency in the design of the query layer. The query layer is composed of three layers: the Graph Query Service, the Storage Abstraction Layer, and the Enrichment Layer, which work together to execute queries efficiently. The authors walk through an example query to demonstrate how the query layer works in practice, highlighting the importance of reading and interpreting the request, reading from storage efficiently, executing traversal with breadth-first levels, running many operations in parallel, filtering smartly, and making repeat queries faster with caching. The goal of the query layer is to complete queries in under 100ms, and the authors demonstrate how their design achieves this goal. The query layer is designed to handle tens of thousands of queries per second, each potentially different, and the authors discuss the trade-offs they made in designing the query layer to achieve this level of performance. Overall, the authors provide a detailed overview of the design and implementation of the query layer, highlighting the challenges and trade-offs involved in building a high-performance query layer for a large-scale distributed graph. The query layer is a critical component of the Real-Time Distributed Graph, and the authors' design and implementation have enabled Netflix to power real-time insights for their internal partners.