Design Facebook News Feed

Problem

Design the News Feed system that ranks and delivers posts to billions of users with sub-second latency.

Requirements

Functional:

  • Generate a personalized feed per user
  • Support posting, likes, comments fan-out
  • Rank by relevance, not just recency
  • Real-time updates for active users

Non-functional:

  • 2B+ users, millions of posts/sec
  • p99 feed load < 1s
  • High availability

Discussion points

  1. Fan-out-on-write vs fan-out-on-read (hybrid for celebrities)
  2. Feed ranking: candidate generation -> ranking model
  3. Caching layers and pagination
  4. Handling the 'thundering herd' for viral posts
  5. Push vs pull for real-time delivery
added …
LeaderboardSalaryAccount