Social News Feed – Scale-Up

12 min · scale-up · intermediate

Social News Feed – Scale-Up

Context: 5M DAU, 1M posts/day. Read-heavy; users check feed often.

Scale-Up Design

  • Feed precomputation: Fan-out on write. When user posts, write to feeds of all followers (async workers).
  • Cache: Redis for hot feeds. TTL ~5min.
  • DB: Read replicas for graph and post queries. Shard posts by user_id if needed.
  • Ranking: Add simple scoring (recency + engagement) in precomputed feed.

Migration Path

  1. Add Redis cache for pull model (quick win)
  2. Introduce async workers for push
  3. Gradual rollout: push for new posts, pull for legacy

Inline Check 1

What is the main bottleneck when scaling a pull-based feed?

<!-- quiz-candidate: true -->