Skip to content
HLD Learn/Real-Time Systems
Browsing as a guest. Sign in to save your progress and earn XP as you complete chapters.

Fan-out Strategies for Feeds

5 min read

You'll learn to

  • -Compare fan-out-on-write and fan-out-on-read

Fan-out on Write (Push)

The moment someone posts, the system immediately copies that post into every one of their followers' precomputed feed lists. Reads are then extremely cheap: just fetch the already-assembled list. The catch is the "celebrity problem": a user with 50 million followers turns one post into 50 million writes.

Fan-out on Read (Pull)

Nothing is precomputed. When a user opens their feed, the system fetches recent posts from everyone they follow and merges them on the spot. Writes stay cheap no matter how many followers someone has, but reads get expensive for a user who follows thousands of accounts.

The Hybrid Approach

Most large-scale feed systems use both: push (fan-out on write) for ordinary accounts, and pull (fan-out on read, merged in at request time) specifically for celebrity accounts whose follower count would make push prohibitively expensive. This is exactly the kind of "know the access pattern, then pick per-case" trade-off this course keeps returning to.

Regular User Posts
Celebrity Posts
Fan-out Worker
Follower Feed Cache
Reader

Regular users are fanned out on write for fast reads; celebrity posts are pulled and merged in at read time instead.

Regular User PostsFan-out Worker- fan-out on writeFollower Feed CacheReader- precomputedCelebrity PostsReader- pulled + merged at read time

The Capstone module later in this course walks through a full news feed design end to end: real follower-count math, the exact write-amplification numbers, and the hybrid threshold logic in detail.

Interview Signal is part of Pro

See a real weak answer next to a real strong one for this exact topic.

Quiz is part of Pro

Test what you just read with a short quiz, and bank the XP.

Ready to Build This?

Level 10 (News Feed) and Level 11 (Chat System) are this module's two flagship exercises.