Design a News Feed System (Twitter / Facebook / LinkedIn)
Generate personalized timelines: Fan-out on Write (Push) vs Fan-out on Read (Pull), Hybrid Fan-out for celebrity accounts, Redis timeline caching, and ranking.
01.1. Functional & Non-Functional Requirements
A News Feed system aggregates, ranks, and serves a personalized stream of content (posts, photos, status updates) generated by the accounts, friends, and entities a user follows.
Functional Requirements
- Feed Publishing: A user can publish a text/image post.
- Feed Generation & Retrieval: A user can fetch a paginated list of the most recent and relevant posts from all accounts they follow.
- Follow Graph: Users can follow and unfollow other accounts.
- Ranking & Chronology: Support chronological ordering (Reverse-Chronological) and ML-ranked scoring (Engagement/Relevance).
Non-Functional Requirements
- Ultra-Fast Read Latency: Feed retrieval must return the first page of 20 posts in
< 20 ms(p99). - Scale: Support
500 milliondaily active users (DAU) generating100 millionposts/day and10 billionfeed page views/day. - Handling Celebrity Hotspots (The "Justin Bieber / Elon Musk Problem"): An account with 100M+ followers must be able to post without stalling the platform or creating multi-minute write latency lag.
Hybrid Fan-Out News Feed Generation Architecture ๐ฐ
Hybrid Fan-Out News Feed Generation Architecture ๐ฐ
Pushing feeds into Redis Sorted Sets for standard users while dynamically merging celebrity posts on read to prevent write stampedes.
Unlock Topic #238: Design a News Feed System (Twitter / Facebook / LinkedIn)
You are viewing a preview. The full in-depth engineering deep dive, interactive simulators, architecture flowcharts, and self-assessment quizzes for this topic are available with Pro or Lifetime Access.
Failure modes, high-throughput bottlenecks, and real FAANG implementation decisions.
Interactive system topology diagrams, live parameter simulators, and downloadable SVG charts.
Staff-level multiple-choice quiz questions with instant feedback and answer explanations.
Firebase Google authentication automatically syncs your completed topics and quiz scores.
How clear and staff-actionable was this system breakdown?