← All concepts
Messaging & flow
Fan-out (push vs pull feeds)
Deliver one item to many recipients — either copied at write time or gathered at read time.
Feeds (Instagram, Twitter, notifications) face a choice. Fan-out on write copies a new post into every follower's feed so reads are instant. Fan-out on read gathers posts from everyone you follow when you open the feed.
Most real systems are hybrid: push for normal accounts, pull for celebrities with millions of followers.
See it in action
Step through the scenarios on the diagram.
Laying out diagram…
1/5A normal user with 300 followers posts.
- Author
- — Posts something
- Post service
- — Stores the post
- New-post events
- — One per post
- Fan-out workers
- — Copy post ids to followers' feeds
- Feed cache
- — A list per follower
- Follower
- — Opens their feed
- Feed service
- — Reads the list, merges celebrities
- Posts store
- — Every post by author
How it works
- Write path: event → fan-out workers → append postId to each follower's cached list.
- Read path: fetch the cached list, merge recent celebrity posts, rank, hydrate.
Trade-offs
- Push: huge write amplification for popular accounts, wasted work for inactive users.
- Pull: slow reads that touch many sources.