Skip to main content
PreparationZone Logo
PrepZone

News Feed Design

Pull versus push fan-out, ranking and the hot-path optimisations behind Twitter and Facebook feeds.

Pass checkpoint below

Read these first

Design StreamHub's activity feed: when a followed streamer goes live or posts a clip, subscribers see it in their feed within seconds. Celebrities with 10M followers break naive push fan-out — the hybrid model solves this.

Requirements

Functional requirements

  • Home feed: chronological or ranked list of posts from followed streamers.
  • Publish post: streamer creates a clip highlight, schedule announcement, or go-live event.
  • Follow/unfollow streamers; feed updates accordingly.
  • Like and comment on feed items (basic engagement).
  • Feed pagination: infinite scroll with cursor.

Non-functional requirements

  • Latency: feed load under 300 ms p99.
  • Scale: 100M DAU; avg 200 follows per user; 10M posts/day.
  • Fan-out: Celebrity streamers with up to 10M followers.
  • Freshness: New posts appear within 5 seconds for active users.
  • Availability: 99.9% — feed is the home screen.

Out of scope: ML ranking model internals, ads insertion, stories/ephemeral content.

Estimation

  • 100M DAU × 10 feed loads/day = 1B feed reads/day ≈ 12K QPS average, ~40K peak.
  • 10M posts/day × 200 avg followers = 2B fan-out writes/day if pure push — 23K writes/sec.
  • Celebrity post (10M followers): 10M writes in one fan-out — must not be synchronous.
  • Feed cache: 200 post IDs × 8 bytes × 100M users = 160 GB if fully materialised — needs tiering.

News feed architecture (AWS)

INTEGRATIONPush (write-time)MSK → Redis timelines
ANALYTICSPull (read-time)OpenSearch + Redis merge
Hybrid fan-out: push timelines for normal users; pull merge for celebrities.

The rest of this guide is part of Pro

Free covers every fresher guide in full. Pro unlocks Senior, Staff and Architect guides across every track.

Still to come · 5 sections

  • API design
  • High-level architecture
  • Hybrid fan-out strategy
  • Deep dive: feed read path
  • Deep dive: ranking (optional extension)

Test yourself

Answer these before moving on — recall is what makes it stick.