0 day streak

News feed

A news feed is the scrolling list of recent posts from people you follow, as on Twitter or Instagram, and the design problem is building each person’s list quickly when millions are posting. One approach, fan-out on write, copies every new post into each follower’s precomputed feed, so reading is instant but a post from someone with 50 million followers means 50 million writes. The other, fan-out on read, assembles the feed when you open the app by pulling recent posts from everyone you follow, which is cheap to write but slow to read. Real systems mix them: push for ordinary accounts, pull for celebrities, then rank and cache the result.

In this lesson: Fan-out on write vs on read, with a celebrity-account stress test.