[System Design Tech Case Study Pulse #52] Facebook's News Feed Algorithm Marvel: How it Serves 2.9 Billion Daily Active Users Using PyTorch and Cassandra
With detailed explanation and flow chart....
Hi All,
Facebook's News Feed Algorithm is a engineering marvel, capable of serving personalized content to 2.9 billion daily active users with less than 50ms latency, leveraging PyTorch for machine learning and Cassandra for data storage. This sophisticated system forms the core of Facebook's user experience, delivering relevant and engaging content to users in real time.
Let me deep into how this system works, exploring the key components, technologies, and processes that enable such massive scale, low latency content delivery.
Learn how to Design Facebook Newsfeed
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
Daily Active Users (DAU): 2.9 billion
Posts processed daily: 4+ billion
Peak requests per second: 10 million+
Average feed generation time: < 50ms
ML model inference time: < 10ms
Cassandra read latency: < 5ms for 99% of queries
PyTorch models in production: 1,000+
Features considered per post: 100,000+
Data points processed daily: 100+ trillion
Global data centers: 15+
Edge locations: 100+
System availability: 99.99%
How Real World Scalable Systems are Build — 200+ System Design Case Studies:
System Design Den : Must Know System Design Case Studies
7 Trillion Messages Daily : Magic Behind LinkedIn Architecture and How It Actually Works
1 Billion Tweets Daily : Magic Behind Twitter Scaling and How It Actually Works
12 Million Daily Users: Inside Slack's Real-Time Messaging Magic and How it Actually Works
3 Billion Daily Users : How Youtube Actually Scales
Processing 2 Billion Daily Queries : How Facebook Graph Search Actually Works
1.5 Billion Swipes per Day : How Tinder Matching Actually Works
500+ Million Users Daily : How Instagram Stories Actually Work
2.9 Billion Daily Active Users : How Facebook News Feed Algorithm Actually Works
20 Billion Messages Daily: How Facebook Messenger Actually Works
8+ Billion Daily Views: How Facebook's Live Video Ranking Algorithm Works
How Discord's Real-Time Chat Scales to 200+ Million Users
80 Million Photos Daily : How Instagram Achieves Real Time Photo Sharing
Serving 1 Trillion Edges in Social Graph with 1ms Read Times : How Facebook TAO works
How Lyft Handles 2x Traffic Spikes during Peak Hours with Auto scaling Infrastructure..
8+ Billion Daily Views: How Facebook’s Live Video Ranking Algorithm Processes Daily Views Using Storm and Memcache
Tinder 1.5 Billion Swipes per Day : How Tinder Real Time Matching Actually Works
100+ Million Requests per Second : How Amazon Shopping Cart Actually Works
Serving 132+ Million Users : Scaling for Global Transit Real Time Ride Sharing Market at Uber
How Netflix handles millions of memberships efficiently?
The Billion-Dollar Question — What’s My ETA? How Uber Calculates ETA…
What happens Once You Press Play button on Netflix..
FAANG level — How to Write Production Ready Code ?
Impressive Tech Behind YouTube’s Scaling to 3 Billion Users: Inside Vitess Database Clustering
Binge-worthy Backend: Netflix’s 99.99% Uptime Serves 230Million Users Globally!
At Amazon How 310 Million Users Experience Lightning-Fast Load Times
How to solve any system design question ( with detailed case study example)
How PayPal Manages Over 400 Million Active Accounts Seamlessly?
This is How it works ( Complete Process Flow) as follows —
1. User opens the Facebook app or website:
- The client-side SDK initializes and establishes a connection with Facebook's servers.
- The SDK sends user information and device details to the Real-time User Activity Service.
2. Real-time User Activity Service processes user data:
- Updates the user's interest profile based on their recent activities and interactions.
- Sends relevant user data to the Feed Assembly Service to start constructing the personalized feed.
3. Feed Assembly Service retrieves top-ranked content:
- Sends a request to the Ranking Service with the user's information and contextual data.