Ignito

Ignito

Ignito

[System Design Tech Case Study Pulse #8] Processing 2 Billion Daily Queries Using Unicorn and Apache Thrift : Facebook's Graph Search Secret Sauce

With detailed explanation and flow chart....

Naina Chaturvedi's avatar
Naina Chaturvedi
Oct 04, 2024
∙ Paid
Share

Hi All,

Facebook's Graph Search is capable of processing 2 billion daily queries using Unicorn, a custom-built inverted index and retrieval system, and Apache Thrift for efficient inter-service communication. This sophisticated system forms the backbone of Facebook's ability to provide real-time, personalized search results across its vast social graph.

Let me dive deep into how this system works, exploring the key components, technologies, and processes that enable such massive-scale, low-latency graph search capabilities. 

Learn how to Design Facebook Newsfeed

[System Design Tech Case Study Pulse #2] How Lyft Handles 2x Traffic Spikes during Peak Hours with Auto scaling Infrastructure..

We will continue to add a growing amount of system design, projects and ML/AI content. Ignito ( this publication) urgently needs you and your support (else Ignito will shut down). If you like Ignito publication and my work please support with some ( even a small amount is good) help/donation : Link

System Overview 

Before we delve into the search architecture, let us look at some key metrics of Facebook's Graph Search system: 

- Daily search queries: 2 billion+ 

- Peak queries per second: 100,000+ 

- Indexed entities: Trillions (users, posts, pages, etc.) 

- Edge types in the graph: 100,000+ 

- Average query latency: < 100ms 

- Unicorn servers: 1000+ 

- Data centers: 10+ 

- Daily index updates: Billions 

- Query types supported: Keyword, structured, natural language 

- Languages supported: 100+ 

- System availability: 99.99% 

- Index size: Petabytes of data 

- Thrift RPC calls per query: 50+ on average 


  1. Master System Design with System Design Case Studies

  2. Master Data Structures and Algorithms and curated Questions List

    ( Company wise)

  3. Build Projects and master the most important topics

Ignito System Design Youtube Channel
System Design Github - Link

Learn system design pulses -

[System Design Pulse #1] Understanding Latency and Throughput: Critical Factors in System Design and Performance Tuning

[System Design Pulse #2] Striking the Right Balance: Optimizing Availability and Consistency in Distributed Architectures

[System Design Pulse #3] THE theorem of System Design and why you MUST know it - Brewer theorem

[System Design Pulse #4] How Distributed Message Queues Work?

[System Design Pulse #5] Breaking It Down: The Magic Behind Microservices Architecture

[System Design Pulse #6] Why Availability Patterns Are So Crucial in System Design?

[System Design Pulse #7] How Consistency Patterns helps Design Robust and Efficient Systems?

[System Design Pulse #8] Caching is Crucial : How Caching Slashes Latency and Supercharges Performance

[System Design Pulse #9] Why these Key Components are Crucial for System Design.


How it works —

1. User submits a search query through the Facebook App or Website.

This post is for paid subscribers

Already a paid subscriber? Sign in
© 2025 Naina
Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture