How Netflix Content Engineering makes a federated graph searchable (Part 2)

Netflix Technology Blog
8 min readintermediate
--
View Original

Overview

This article discusses how Netflix's Content Engineering team has implemented a federated graph search system, focusing on the querying capabilities of Studio Search. It details the design of a custom Domain Specific Language (DSL) for search queries, the integration with GraphQL, and the security measures in place for accessing sensitive data.

What You'll Learn

1

How to use a custom DSL to simplify search queries in a federated graph

2

Why integrating GraphQL with search services enhances data retrieval

3

How to implement query-time security for sensitive data access

Prerequisites & Requirements

  • Understanding of GraphQL and Elasticsearch
  • Familiarity with building APIs and query languages(optional)

Key Questions Answered

How does Netflix's Studio Search enable querying of a federated graph?
Netflix's Studio Search uses a custom Domain Specific Language (DSL) that abstracts the complexities of Elasticsearch, allowing users to express search criteria easily. This DSL supports logical operators and filters, enabling efficient known-item searches and data retrieval within a federated graph.
What security measures are implemented for accessing search indices?
Netflix employs a 'late binding' security model where each search query is evaluated against a centralized access policy server. This ensures that users only retrieve data they are authorized to access, based on their identity and the specific search index being queried.
What are the benefits of using a federated gateway for search services?
The federated gateway allows the search service to return only matching entity keys instead of full documents, enabling efficient data hydration from the federated graph. This approach keeps the search indices lean while providing flexibility to access additional data as needed.

Technologies & Tools

Some links below are affiliate links. We may earn a commission if you make a purchase.

Key Actionable Insights

1
Implement a custom DSL for your search queries to simplify user interactions with complex data systems.
By abstracting the underlying complexities of search engines like Elasticsearch, users can focus on crafting effective search queries without needing deep technical knowledge of the search engine.
2
Utilize GraphQL for integrating search functionalities to enhance data retrieval capabilities.
GraphQL's flexible querying allows users to fetch only the necessary data, improving performance and user experience in applications that require dynamic data access.
3
Adopt query-time security measures to protect sensitive data in your applications.
By applying access constraints at query time, you can ensure that users only receive data they are authorized to view, thus maintaining data integrity and compliance with security policies.

Common Pitfalls

1
Incorrectly constructed nested queries in Elasticsearch can lead to wrong results.
This often happens due to the complexity of building queries for nested JSON documents. To avoid this, ensure that your query structure is well understood and validated before execution.

Related Concepts

Federated Graphs
Domain Specific Languages
Graphql Apis
Search Indexing Techniques