Project 13
Social media feed
Feed generation and fan-out
Brief
Follow users, post content, read a home feed; likes and counts; media served via CDN.
Targets
10M DAU · feed load p99 < 200 ms · a new post visible to followers within 30 s · celebrity accounts with 10M followers handled.
Must cover
- Fan-out choice and very popular accounts — the hybrid decision with arithmetic (→ 99).
- Ranking basics — a pluggable scoring boundary over the chronological core (P).
- Privacy filtering — blocked users and private accounts enforced at read time (P).
- Moderation hooks — takedowns propagate to pushed feed copies (P).
Design challenges
- The fan-out decision (→ 99): fan-out on write (push to follower feed caches) vs. fan-out on read (merge at request time) vs. the hybrid — push for normal users, pull for celebrities — with cost arithmetic at the stated scale (→ 20).
- Feed storage (→ 87): sorted sets per user — memory sizing, truncation, cold-user rebuild.
- Counters at scale (→ 88): sharded counters, eventual accuracy, cached display values.
- Sortable, decentralized post IDs (→ 75).
- Deletion and moderation propagating through pushed copies (→ 129).
- Read-your-own-post consistency while followers get eventual (→ 129).
Out of scope
ML ranking (→ 216), stories and video pipelines (Project 18).