Fan-out Strategies for Feeds
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 users are fanned out on write for fast reads; celebrity posts are pulled and merged in at read time instead.
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.
Level 10 (News Feed) and Level 11 (Chat System) are this module's two flagship exercises.