DISTRIBUTED SYSTEMS & ARCHITECTURE · SUBTOPIC
Feed Fan-Out: Push vs. Pull (Hybrid)
How Twitter/Instagram deliver posts to millions of followers without melting.
IntermediatePart of Real-Time Communication
Subtopics in Real-Time Communication (2)
In plain words
When someone with 50 friends posts, the system drops a copy in all 50 friends’ feed boxes right away (Push). When Taylor Swift with 100 million followers posts, copying 100 million times would crash everything - so her posts are fetched when you open the app (Pull).
Think of it like…
Dropping flyers in 20 neighbors’ mailboxes (Push) vs. putting up a billboard everyone reads when they drive by (Pull).
Loading interactive diagram
Loading interactive exercise
Theory & how it works
Why Hybrid Fan-Out is the classic interview answer
Pure push fails on celebrities (huge write amplification + lag). Pure pull makes every feed open run slow JOINs across everyone you follow. Hybrid fan-out pushes for 99.9% of users and pulls-and-merges only the few celebrities you follow.
Key points & practical guide
Summary checklist
- Fan-out on write = fast reads, heavy writes for huge accounts
- Fan-out on read = cheap writes, slower reads
- Hybrid threshold (e.g., >10k–100k followers → pull) gives the best of both
When to use it
- Social feeds (X, Instagram, LinkedIn), activity streams, notifications
Watch out for
- Attempting synchronous fan-out inside the
POST /tweetHTTP request instead of an async queue
Quick check
Loading quiz