SlideShare a Scribd company logo
GraphQL
Search
Artem Shtatnov
GraphQL Summit 2019
Escape Room Game?
How can we quickly search and aggregate
data spread across multiple sources?
Roadmap
Indexing
the Data
Keeping It
Updated
Data Flow Learnings
Marketing Tech at Netflix
Creatives
Our Data
query getAllCreatives() {
creative {
id
...AllCreativeFields
show {
...AllShowFields
titleRanking {
...AllTitleRankingFields
}
}
comments {
...AllCommentFields
}
}
}
Creative Service
Show Service
Title Ranking Algo
Comment Service
50 Million
Roadmap
Indexing
the Data
Keeping It
Updated
Data Flow Learnings
Indexing Data
● Iterate over all creatives
● Call our GraphQL server
with a query
● Put the result into
Elasticsearch
query getCreativesById($creativeIds: [UUID]) {
creative(creativeIds: $creativeIds) {
id
...AllCreativeFields
show {
...AllShowFields
titleRanking {
...AllTitleRankingFields
}
}
comments {
...AllCommentFields
}
}
}
After Our Data is Indexed
● Sort, group, and filter the data on arbitrary fields
● Provide type-ahead suggestions
● Implement faceted search
● Display results with infinite scroll
● Our page loads much faster
Roadmap
Indexing
the Data
Keeping It
Updated
Data Flow Learnings
Keeping the Index Up To Date
● If the creative changes, then reindex that creative
● if the show changes, then reindex the creative with that
show id
● If the title ranking changes, then find the related show, use
the show to find the creative, and reindex it
● if a comment changes, then reindex the creative with that
comment id
If our data changes, we need to reindex
GraphQL Defines Relationships in Our Data
Title Ranking
Show
Creative
Comments
Auto Search Indexer
Title Ranking
Show
Creative
Comments
1. Change event
Auto Search Indexer
1. Change event
2. Fan out one level
Title Ranking
Show
Creative
Comments
Auto Search Indexer
1. Change event
2. Fan out one level
3. Search all indexed
documents
Title Ranking
Show
Creative
Comments
Elasticsearch
Auto Search Indexer
1. Change event
2. Fan out one level
3. Search all indexed
documents
4. Rebuild and reindex
documents
Title Ranking
Show
Creative
Comments
Auto Search Indexer
1. Change event
2. Fan out one level
3. Search all indexed
documents
4. Rebuild and reindex
documents
rebuild
search
fan out
change
Roadmap
Indexing
the Data
Keeping It
Updated
Data Flow Learnings
Data Flow: Before Indexing
BrowserGraphQL
aggregation on page load (read)
Creative
Service
Show Service
Title Ranking
Algo
Commenting
Service
Data Flow: After Indexing
BrowserGraphQL
Creative
Service
Show Service
Title Ranking
Algo
Commenting
Service
Elasticsearch
aggregation on data change (write)
Data Flow: Abstract Elasticsearch
BrowserGraphQL
Creative
Service
Show Service
Title Ranking
Algo
Commenting
Service
Elasticsearch
GraphQL can choose its data source
Search becomes a plugin that you can enable
on a GraphQL server with minimal configuration
Roadmap
Indexing
the Data
Keeping It
Updated
Data Flow Learnings
Initial Setup of the Search Indexer
Search
Indexer
GraphQL
Kafka
Elasticsearch
1. Use GraphQL - graph edges must be bidirectional
2. Listen to change events
3. Index to a search database
1. Define a GraphQL query
2. Done
How to Build a New Index
Search Indexer Performance
Fan out Search Rebuild+ +Change +
< 500ms
=
More Information on Monday
medium.com/netflix-techblog
GraphQL Search Indexing
● Robust search and instant page loads
● Minimal refactoring on the client side
● Configuration driven and automated
+
Thank You
Artem Shtatnov
medium.com/netflix-techblog

More Related Content

PPTX
Introduction to graphQL
PDF
GraphQL Advanced
PDF
REST vs GraphQL
PDF
Intro to GraphQL
PPTX
Introduction to GraphQL
PPTX
An intro to GraphQL
PDF
Graphql
PDF
GraphQL: Enabling a new generation of API developer tools
Introduction to graphQL
GraphQL Advanced
REST vs GraphQL
Intro to GraphQL
Introduction to GraphQL
An intro to GraphQL
Graphql
GraphQL: Enabling a new generation of API developer tools

What's hot (20)

PDF
GraphQL Fundamentals
PDF
GraphQL
PPT
Graphql presentation
PDF
GraphQL London January 2018: Graphql tooling
PDF
Better APIs with GraphQL
PPTX
GraphQL Introduction
PPTX
Into to GraphQL
PDF
GraphQL as an alternative approach to REST (as presented at Java2Days/CodeMon...
PDF
GraphQL in an Age of REST
PDF
GraphQL across the stack: How everything fits together
PDF
Why UI Developers Love GraphQL - Sashko Stubailo, Apollo/Meteor
PDF
How to GraphQL
PDF
GraphQL + relay
PDF
Modular GraphQL with Schema Stitching
PDF
PDF
Performance optimisation with GraphQL
PDF
Adding GraphQL to your existing architecture
PDF
The Apollo and GraphQL Stack
PDF
GraphQL: The Missing Link Between Frontend and Backend Devs
GraphQL Fundamentals
GraphQL
Graphql presentation
GraphQL London January 2018: Graphql tooling
Better APIs with GraphQL
GraphQL Introduction
Into to GraphQL
GraphQL as an alternative approach to REST (as presented at Java2Days/CodeMon...
GraphQL in an Age of REST
GraphQL across the stack: How everything fits together
Why UI Developers Love GraphQL - Sashko Stubailo, Apollo/Meteor
How to GraphQL
GraphQL + relay
Modular GraphQL with Schema Stitching
Performance optimisation with GraphQL
Adding GraphQL to your existing architecture
The Apollo and GraphQL Stack
GraphQL: The Missing Link Between Frontend and Backend Devs
Ad

Similar to GraphQL Search (20)

PPTX
Automotive industry ppt
PDF
Getting Started with GraphQL && PHP
PPTX
Data visualization in python/Django
PPTX
Building a GraphQL API in PHP
PDF
Access to User Activities - Activity Platform APIs
PPTX
GraphQL Summit 2019 - Configuration Driven Data as a Service Gateway with Gra...
PPTX
That's Rich! Putting a smile on ADF Faces (ODTUG Kaleidoscope 2009)
PPT
Learning with F#
PDF
PDF
Performant APIs with GraphQL and PHP (Dutch PHP 2019)
PDF
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
PPTX
Introduction to Shiny for building web apps in R
PDF
How to grow GraphQL and remove SQLAlchemy and REST API from a high-load Pytho...
PPTX
Alexandria ACM Student Chapter | Specification & Verification of Data-Centric...
PDF
GraphQL the holy contract between client and server
PPTX
8-9-10. ASP_updated8-9-10. ASP_updated8-9-10. ASP_updated
PDF
Composable and streamable Play apps
PDF
VMWorld 2017 Hackathon training: Getting Started with Clarity
PDF
Tutorial: Building a GraphQL API in PHP
PPT
Skills Portfolio
Automotive industry ppt
Getting Started with GraphQL && PHP
Data visualization in python/Django
Building a GraphQL API in PHP
Access to User Activities - Activity Platform APIs
GraphQL Summit 2019 - Configuration Driven Data as a Service Gateway with Gra...
That's Rich! Putting a smile on ADF Faces (ODTUG Kaleidoscope 2009)
Learning with F#
Performant APIs with GraphQL and PHP (Dutch PHP 2019)
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Introduction to Shiny for building web apps in R
How to grow GraphQL and remove SQLAlchemy and REST API from a high-load Pytho...
Alexandria ACM Student Chapter | Specification & Verification of Data-Centric...
GraphQL the holy contract between client and server
8-9-10. ASP_updated8-9-10. ASP_updated8-9-10. ASP_updated
Composable and streamable Play apps
VMWorld 2017 Hackathon training: Getting Started with Clarity
Tutorial: Building a GraphQL API in PHP
Skills Portfolio
Ad

Recently uploaded (20)

PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Machine learning based COVID-19 study performance prediction
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Modernizing your data center with Dell and AMD
PDF
Approach and Philosophy of On baking technology
PDF
Empathic Computing: Creating Shared Understanding
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Encapsulation theory and applications.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PPTX
MYSQL Presentation for SQL database connectivity
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
A Presentation on Artificial Intelligence
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Big Data Technologies - Introduction.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Machine learning based COVID-19 study performance prediction
Review of recent advances in non-invasive hemoglobin estimation
Modernizing your data center with Dell and AMD
Approach and Philosophy of On baking technology
Empathic Computing: Creating Shared Understanding
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Encapsulation theory and applications.pdf
20250228 LYD VKU AI Blended-Learning.pptx
CIFDAQ's Market Insight: SEC Turns Pro Crypto
MYSQL Presentation for SQL database connectivity
The AUB Centre for AI in Media Proposal.docx
A Presentation on Artificial Intelligence
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Advanced methodologies resolving dimensionality complications for autism neur...
Big Data Technologies - Introduction.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation

GraphQL Search