Course contentsShow
← System Design
Lesson 1638 of 1,91940. Real-World System: Social Media FeedFree lesson

Push (Write-Time) Feed Model

Pre-compute and fan out each new post to all followers' timelines immediately, enabling fast reads but costly writes.

Push (Write-Time) Feed Model

What you'll learn: How the push model pre-computes feeds at write time to enable lightning-fast reads by fan-out copying posts to all followers immediately.

Core Concept

The push (write-time) feed model works like a newspaper delivery service. When someone publishes a post, the system immediately copies (or "fans out") that post into the pre-built feeds of all their followers. It's like the publisher delivering today's newspaper directly to every subscriber's doorstep overnight.

When a user opens their feed, they simply read what's already waiting for them—no computation needed. This makes reads extremely fast: just a simple lookup of "what's in my inbox."

How It Works

  1. User A creates a post → triggers write operation
  2. System fetches User A's follower list (could be millions)
  3. For each follower, insert post reference into their feed cache/database
  4. Done — all followers now have this post in their pre-computed feed

Trade-offs

Advantages:

  • Blazing fast reads — feeds are pre-built, just fetch and display
  • No complex join queries at read time
  • Predictable read latency — same for 10 or 10 million followers viewing

Disadvantages:

  • Expensive writes — celebrities with millions of followers create massive fan-out
  • Storage overhead — same post duplicated across many feeds (or references stored)
  • Wasted effort — computing feeds for inactive users who may never read them

This model works best when users have relatively few followers and high engagement rates.

Key Takeaway:
Push feed models trade write-time cost (fan-out to all followers) for read-time speed (pre-computed feeds), making them ideal for users with smaller, highly-active audiences.