Curriculum · Module 10, Design Walkthroughs
Design a news feed
Build a timeline for each reader. Push on write makes reads cheap and breaks on celebrities, pull on read does the reverse, and a hybrid splits accounts by follower count.
What each topic covers
- A feed shows each reader the recent posts of the accounts they follow. The work can be done when a post is made or when a feed is read, and both can hurt.
- Size a feed service, then define the calls and the three tables behind them.
- Build feeds for 1,000 users in each mode and raise the follower skew to see write backlog and read time move.
- Push cost follows the author's follower count, so a few huge accounts flood the writers and delay posts for everyone.
- Push for ordinary accounts, pull for the few big ones, and merge the two when a feed is read.
- Keep ids in a capped list per reader, and page with a cursor so new posts do not shift the pages.
- Three quick checks on push cost, the hybrid and paging, with the sources behind the lesson.
Topics
Practise this lesson
8 interview questions on news feed, with worked answers and sources.
Your progress is saved in this browser. Sign in to keep it on every device. Privacy · Terms