Stage 5 · Architecture patterns · Medium · 20 min
Event-driven fan-out: push vs pull
When someone posts, copy the post into every follower's feed at once (push), or build each feed when it is opened (pull). Learn when to mix the two.
What each interview level is expected to know
Learn first: Caching strategies, Message queues and Kafka
After this lesson you can:
- Compare fan-out on write with fan-out on read for a news feed.
- Explain the celebrity problem, and how a mixed design solves it.
- Handle deleted posts and out-of-order items in feeds.
Start here
See it in 60 seconds
Push a post, or pull it
A new post can be copied into every follower's feed at once, or fetched when they open the app; big apps mix both.
Scene 1 of 6 · A new post
Someone with 3 followers posts a photo, and all 3 home feeds should show it.
- Poster — healthy — 3 followers
- Post service — healthy
- Feed lists — healthy
- Followers — healthy
- Feed writes for one post
- not shown yet
- Reads each time a feed opens
- not shown yet
- A new post. Someone with 3 followers posts a photo, and all 3 home feeds should show it.
- Push: copy it out. With push, the post is copied into each follower's feed list right away: 3 small writes.
- Opening is instant. Opening the app then reads one ready-made list, so the feed appears at once.
- A star posts. But a star with 10,000,000 followers makes 10,000,000 feed writes for one post, which can take minutes.
- Pull: build on open. With pull, nothing is copied; each open asks every followed account for new posts, say 200 reads.
- Mix the two. So big apps push for most accounts, and pull only for the few with over 50,000 followers.
- Now you try. Pick how many followers the poster has. For example: 10,000,000 followers: pure push makes 10,000,000 feed writes per post; pure pull makes none, but each open reads about 200 accounts. Above about 50,000 followers, a mixed design skips the copies: each open reads its ready-made list plus this account's posts.
Scene 1 of 6: A new post. Someone with 3 followers posts a photo, and all 3 home feeds should show it.
Key points
- Push copies each post into every follower's feed list, so opening the app is instant.
- Pull copies nothing; each feed is built when its owner opens the app, which is slower.
- A star with millions of followers makes push write millions of feeds for one post.
- So many apps push for most accounts and pull only for those above about 50,000 followers.
In plain words
Say an account with 3 followers shares a photo. With push, the system writes the post into all 3 followers' feeds straight away: 3 small writes. When a (On social apps: a user who follows another account, so that account's posts appear in their feed.) opens the app, their feed is one ready list. Now a star with 10,000,000 followers posts. Push means 10,000,000 writes for that one post, and the last followers see it minutes late. With pull, nothing is copied at post time. A feed is put together only when its owner opens the app, by asking every account they follow. That makes opening slower. Copying one post out to many followers is called (Sending one piece of work to many places. That could mean copying one post into many followers' feeds, or one request calling several services and waiting for all of them.).
Real feeds mix the two. Posts from ordinary accounts are pushed, so most feeds are ready lists. Posts from the few huge accounts are pulled when a follower opens the app, and merged into that ready list. Where the line between ordinary and huge sits is a setting, chosen by weighing the cost of writes against the delay on reads.
The problem it solves
Feeds are read far more often than posts are written, so a feed should be ready before its owner asks. But building it ahead of time costs one write per follower for every post. For most accounts that is a few hundred writes. For a star it is millions, all for a single post.
Why it matters
A feed must open fast for every user, and a post must reach every follower. Those two goals pull against each other when one account has 10 million followers. The same choice comes up in feed, timeline and notification designs, so interviewers expect you to know both sides.
A worked example
Say an account has 200,000 followers, and writing one follower's feed entry takes about 3 ms. Push then costs about 200,000 × 3 = 600,000 ms of write work for one post, which is 600 seconds, or 10 minutes, of combined work. Pull instead adds no extra writes at post time; the feed for each follower builds only when that follower opens the app.
Think of it like…
Think of a newspaper. Push is home delivery: a copy is dropped at every reader's door, wanted or not. Pull is a newsstand: nothing is delivered, and each reader walks over when they want one.
Where this analogy stops working
Work at sending time against work at reading time is the useful part. But a newspaper is the same for everyone. A feed is different for each reader. With pull, the system must gather posts from every account the reader follows. Real feeds mix both: push for most accounts, pull for the largest.
Try it
See it working
Mechanics
How it works
The pictures follow this page's numbers: 200 followers, a star with 10,000,000, and a threshold of 50,000. The workers write a stated 100,000 feed entries a second.
Push model (fan-out on write)
When a user posts, workers add the post's id to a stored feed for each follower. A user with 200 followers causes 200 small writes. Reading a feed is then one fast lookup, because the list is already built. A stored feed is often called a timeline.
The celebrity problem
Pick a case to follow belowWith this case: Pushing to 200 followers took 200 writes and 2 ms.
Poster, shares a photo Poster shares a photo Posts, by author, NOW Posts by author saved once NOW Workers, copy post ids Workers copy post ids Stored feeds, one per user Stored feeds one per user Reader, follows 200 Reader follows 200 - Poster — shares a photo — healthy
- Posts — by author — healthy — NOW — saved once
- Workers — copy post ids — healthy
- Stored feeds — one per user — healthy
- Reader — follows 200 — healthy
- Post or lookup
- Feed write
Step 1 of 2Step 1 of 2 · Posts
Done: An ordinary account shares a photo
- What happens
- The post is saved once. It has 200 followers.
- Why
- Push builds each follower's feed now, so reading it later is fast.
- What changes
- The fan-out workers start copying its id into feeds.
- Next
- The workers write 200 feed entries
Feed writes for this post0Last follower sees it after–not done yetStep 1 of 2: Posts. An ordinary account shares a photo. The post is saved once. It has 200 followers.
A user with 10 million followers causes 10 million writes for one post. The workers fall behind, and followers see the post minutes late. Other users' posts wait in the same (A waiting line for work. One part adds messages, and another takes them off and handles them later, at its own pace.) behind it.
In the picture, a post to 200 followers takes 200 writes and 2 ms. A star's post takes 10,000,000 writes and 100 seconds, and an ordinary post made a second later waits behind it.
Pull model (fan-out on read)
Pick a case to follow belowWith this case: The stored feed opened with 1 lookup, because push had built it ahead of time.
Poster, shares a photo Poster shares a photo Posts, by author Posts by author Workers, copy post ids Workers copy post ids Stored feeds, one per user, NOW Stored feeds one per user 1 lookup NOW Reader, follows 200 Reader follows 200 - Poster — shares a photo — healthy
- Posts — by author — healthy
- Workers — copy post ids — healthy
- Stored feeds — one per user — healthy — NOW — 1 lookup
- Reader — follows 200 — healthy
- Feed
Step 1 of 1Step 1 of 1 · Stored feeds
Done: The system reads one stored list
- What happens
- The reader's feed was built as each post was made.
- Why
- Push did the work when the posts were made.
- What changes
- The feed is ready to show.
- Next
- The run ends here.
How it ended. The stored feed opened with 1 lookup, because push had built it ahead of time.
Lookups to open the feed1ready-made listMerge at read timenoStep 1 of 1: Stored feeds. The system reads one stored list. The reader's feed was built as each post was made.
Nothing is stored per follower. When a user opens the app, the system fetches recent posts from everyone they follow and merges them. Posting is cheap, but every feed read does much more work: 200 lookups for a user who follows 200 accounts.
In the picture, a reader who follows 200 accounts opens the app. With a stored feed, that is 1 lookup. With pull, it is 200 lookups and a merge, on every open.
Hybrid
Poster, shares a photo Poster shares a photo Posts, by author, NOW Posts by author saved, not pushed NOW Workers, copy post ids Workers copy post ids Stored feeds, one per user Stored feeds one per user Reader, follows 200 Reader follows 200 - Poster — shares a photo — healthy
- Posts — by author — healthy — NOW — saved, not pushed
- Workers — copy post ids — healthy
- Stored feeds — one per user — healthy
- Reader — follows 200 — healthy
- Post or lookup
- Feed
Step 1 of 3Step 1 of 3 · Posts
Done: A star posts, and nothing is pushed
- What happens
- The star has over 50,000 followers, so the post is only saved.
- Why
- Pull for stars removes the 10 million writes.
- What changes
- Ordinary accounts' posts are still pushed as before.
- Next
- The reader's stored feed holds posts from 198 accounts
Feed writes for a star's post0Lookups to open the feed0not opened yetStep 1 of 3: Posts. A star posts, and nothing is pushed. The star has over 50,000 followers, so the post is only saved.
What these pictures simplify. These pictures use a stated rate of 100,000 feed writes a second and whole lookups. Real systems add more workers, cache feeds, and tune the threshold. The news feed case study builds a whole feed system.
Use push for most users and pull for the few with huge followings, for example over 50,000 followers. At read time, the system merges the stored feed with fresh posts from the stars that user follows. The threshold is a number you tune, not a fixed rule.
In the picture, the reader follows 198 ordinary accounts and 2 stars. A star's post costs 0 feed writes. Opening the feed takes 3 lookups: the stored feed and one for each star.
Use it when
- A home feed or timeline that must open fast: push builds it ahead of time, so a read is one lookup.
- Notifications for an event many people follow, such as a goal in a match: one event is copied to every follower's device.
- Activity lists in a shared workspace: each member sees the changes made by the people and projects they follow.
- Accounts with very large followings, or users who rarely open the app: pull does the work only when someone reads.
Skip it when
- A page that shows only the user's own data, such as their orders: one query answers it, and nothing needs to be copied.
- Push for followers who never open the app: the writes and the stored feeds are wasted. Build feeds only for recently active users.
- Pull alone when users follow thousands of accounts: every open then needs thousands of lookups.
Check yourself
Judgement
Trade-offs and how it fails
What you give up
- Reads vs writes
- Push makes reads cheap and writes costly: one write per follower, including followers who never look. Pull makes writes cheap and reads costly: every open queries each followed account.
- Memory
- Stored feeds take memory for every user. Keep only post ids in them, not the posts, and cap each list at a fixed length, such as a few hundred ids.
Failure modes
- One star blocks the queue: a post to 10 million followers fills the fan-out workers, and ordinary users' posts wait behind it. Give large fan-outs their own queue, or use pull for those accounts.
- Feeds stored for everyone: users who have not opened the app in months still take memory and writes. Keep feeds only for recently active users, and rebuild one when its owner returns.
- A deleted post stays in feeds: its id was copied into millions of lists. Check that the post still exists when a feed is read.
- Out-of-order feeds: the fan-out is still running, so some followers see a reply before the post it answers.
In the real world
- Twitter engineer Raffi Krikorian gave a talk in 2012, written up on High Scalability in 2013. It gives about 300,000 timeline reads a second, home and search together, against 6,000 write requests. That gap is why Twitter built timelines at write time. Source: High Scalability: Twitter's architecture (2013) (checked 14 October 2026)
- The same write-up says Twitter kept ready timelines only for users active in the last 30 days. It was also moving accounts with very large followings to a merge at read time. Source: High Scalability: Twitter's architecture (2013) (checked 14 October 2026)
- LinkedIn's engineering blog (2016) describes FollowFeed, which builds each feed at read time. In LinkedIn's tests, ready-made feeds for every member needed about 62 times more data. Source: LinkedIn engineering: FollowFeed (2016) (checked 14 October 2026)
Trade-offs to be ready to discuss: Fanout push vs pull
Check yourself
Interview
What interviewers look for
- For a feed design, give both models and then mix them: "Push for most accounts, pull for the few with very large followings."
- Give the numbers that force the choice: "200 followers is 200 writes. 10 million followers is 10 million writes for one post."
- Bound the cost: "We store feeds only for recently active users, and each list holds post ids only, up to a cap."
- Say what a follower of a star sees: "Their feed is the stored list, merged with the star's recent posts at read time."
Say it out loud: How does a hybrid of push and pull solve the celebrity problem in a feed?
Expected depth by interview level
Levels describe the depth interviewers probe, not years of experience. Choose a level on the learning path to highlight it.
- JuniorUseful
- Events decouple services.
- MidCore
- Fan-out on write vs on read for feeds.
- SeniorCore
- The celebrity problem, hybrid fan-out, stream processing.
- StaffExpected
- Event-driven boundaries between teams.
Practice
Apply it
Three harder questions
The first two use the idea on a new case. The last asks you to judge a design.
Apply it
Apply it
Judge a design
Go deeper
Sources and further reading
First-hand sources to check this page against and to go further. They are standards, official docs, original papers, and guides from engineering and security teams. Each link was opened on 8 November 2026.
- Engineering guideWhat do you mean by “Event-Driven”?Martin FowlerFour different patterns that all get called event-driven, and the costs of each.
- Official docsApache Kafka documentationApache Software FoundationHow one published event reaches many independent consumer groups.