What is the difference between fan-out on write and fan-out on read when designing a news feed?
Short answer
Fan-out on write (push) inserts the post id into every follower's inbox at post time: very fast reads, expensive writes. Fan-out on read (pull) gathers posts when the feed opens: cheap writes, slow reads. Real systems use a hybrid.
3 points to say:
- Push: fast reads, O(followers) writes; pull: one write, expensive reads; the hybrid decides by follower count and activity.
- Inboxes store only post ids; content is hydrated at read time.
- Paginate with a cursor, not offset; fan-out runs asynchronously through Kafka.
Keep reading the deep dive
Create a free account to read the full explanation and follow-up questions, mark questions as studied and review them on a schedule.