Design a News Feed
A full case study of a social feed, covering fan-out on write versus read, the celebrity problem, feed caches and pagination.
Requirements
A news feed (or timeline) is the home page that lists recent posts from people you follow.
Functional:
- Publish a post (text, plus image or video links).
- Follow and unfollow users.
- Open the feed: newest-first posts from followed accounts, loaded in pages.
Non-functional:
- Feed loads in a few hundred milliseconds.
- A new post appears in followers' feeds within seconds, not minutes.
- Highly available; slightly stale content is acceptable.
Out of scope here: ranking models, ads, comments, likes counting.
1 of 11