Fan-out on write vs read — and the celebrity problem.
Twitter Feed: fan-out on write vs read
compose the pieces into a design story
Fan-out workers must scale with biggest follower counts.
Twitter-style timelines must serve reads at huge fan-out. Pure fan-out-on-write precomputes timelines per follower; fan-out-on-read computes on demand. Hybrid handles celebrities.
Fan-out-on-write: cheap reads, expensive writes for users with millions of followers.
Fan-out-on-read: cheap writes, expensive reads when many followees exist.
Hybrid: regular users get push fan-out; celebrities use read-time merge.
Cache hot timelines; regenerate via async job.
1B users, 10M tweets/day, 200B timeline reads/day.