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
- Add Redis cache for pull model (quick win)
- Introduce async workers for push
- 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 -->