Facebook News Feed — Notes
Functional
- Aggregate posts from friends, pages, groups, recommendations.
- Rank by relevance (Meaningful Social Interactions).
- Inject ads at known positions.
- React, comment, share, save, hide.
Non-functional
- 3B+ MAU. Feed open p99 < 300 ms.
- Multi-region active-active for reads.
Capacity
- Posts/day: ~5B (incl. comments, reacts).
- Reads/day: 100B+.
- Feed compute: thousands of features × millions of candidates evaluated per session.
Schema (conceptual)
- TAO objects:
user, post, page, group, photo.
- TAO assocs:
friends, likes, follows, posted.
- Posts in sharded SQL by
owner_id.
- Aggregations precomputed and cached.
Trade-offs
- Pull-aggregator is more expensive per read but doesn't suffer the celeb fan-out problem.
- TAO sacrifices some consistency for cross-region read latency.
- Heavy ML demands GPU/TPU; staged ranking (cheap candidate gen → expensive scorer).
- Privacy & integrity complexity dwarfs the ranking complexity.
Refs
- Facebook TAO paper (USENIX ATC '13).
- Haystack (small photo storage) paper.
- "How News Feed Works" engineering posts.
- ByteByteGo & Alex Xu Vol 2.