Interview's MateSystem Design
Interview's Mate

System Design

Architecture & trade-offs

Visualizer

DSA Visualizer
All 32 lessons
Custom Playground
Try your own examples

Learning

System Design
31 architecture topics
SQL Learning
160 foundations → production topics
AI Engineering
160 LLM → backend topics
Data Science
160 Python → MLOps topics
Data Engineer
160 SQL → streaming topics
Docker
160 Docker learning topics
Kubernetes
160 K8s fundamentals → cloud
Java LearnSoon
Coming soon
Python Learn
Interview Q&A & internals
JavaScript Learn
Closures, async & DOM Q&A
Tech Learn
Search, practise & track Q&A
AI DSA Practice
Solve coding problems
Theme
Home
All topics/Real-Time Communication
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
Practice in AI HLD
Subtopics in Real-Time Communication (2)
OverviewPolling, SSE & WSFan-Out Push/Pull

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 /tweet HTTP request instead of an async queue

Quick check

Loading quiz
Previous subtopic
Polling vs. SSE vs. WebSockets
Back to overview
Full Real-Time Communication Lesson