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

Pull (Read-Time) Feed Model

Fetch and merge posts from followed users at request time, offering freshness but higher latency for large follow graphs.

What You'll Learn

You'll learn how the pull (read-time) feed model generates a user's social media feed on-demand by querying and merging posts from followed accounts at the moment of request.


What Is the Pull Model?

In a pull-based feed system, when you open your social media app, the server doesn't have your feed pre-built. Instead, it:

  1. Looks up who you follow
  2. Fetches recent posts from each followed user
  3. Merges and sorts these posts (usually by timestamp)
  4. Returns the unified feed to you

Think of it like calling a friend to ask "What's new?" every time you're curious, rather than having them leave you voicemail updates throughout the day.


How It Works

When Alice requests her feed:

1. Retrieve Alice's follow list: [Bob, Carol, Dave]
2. Query posts table: WHERE author_id IN (Bob, Carol, Dave)
3. Sort results by timestamp DESC
4. Return top N posts to Alice

Trade-Offs

Advantages:

  • Always fresh – You see the latest content immediately
  • No write amplification – When Bob posts, the system doesn't pre-generate feeds for his 1M followers
  • Simple logic – No complex fan-out background jobs

Disadvantages:

  • Slow for popular users – If you follow 5,000 people, querying their posts takes time
  • Database load spikes – Every feed read hits the database with complex queries
  • Poor user experience – Users wait seconds for feeds to load

When to Use It

Pull works well for:

  • Small user bases or low follow counts
  • Systems where freshness matters more than speed
  • Celebrity accounts with millions of followers (to avoid fan-out explosion)

Modern systems often combine pull with push models (hybrid approach) to balance these trade-offs.


Key Takeaway:
The pull model fetches and merges posts at read time, guaranteeing freshness but introducing latency—especially problematic for users with large follow graphs or high-traffic applications.