#08Instagram News Feed
Ranked feed with cursor pagination. No `OFFSET`.

Build the Instagram News Feed: a personalized, ranked, infinitely-scrollable list of posts from the people you follow. The product is read-dominated (≈ 85:1 read:write — feed page fetches 350K QPS peak vs post-creates 4.1K QPS peak), personalized per user (no edge cache for ranked JSON), and ranking-bound (the model is the product — chronological feeds have 30% lower session length per Meta A/B disclosures). The architecture is a two-stage retrieval funnel (candidate gen + early-stage ranker → late-stage ranker), a hybrid fanout (denorm-on-write for normal users, pull-on-read for >100K-follower creators), and cursor pagination (no OFFSET — at depth 1000, offset is 17× slower per the standard cursor-pagination analysis).

This canonical is sized for ~1.5B DAU, derived from public Meta scale figures (Q4 2023 earnings; Mosseri 2021 IG MAU disclosure) and the published architectures it builds on: TAO (USENIX ATC '13), Memcache + leases (NSDI '13), and Haystack/f4/Tectonic (OSDI '10/'14, FAST '21).

Reading: TAO: Facebook's Distributed Data Store for the Social Graph (USENIX ATC '13) · Scaling Memcache at Facebook (NSDI '13) · f4: Facebook's Warm BLOB Storage (OSDI '14) · An Analysis of Facebook Photo Caching (SOSP)
ranking
two-stage retrieval
cursor pagination
fanout-on-write vs fanout-on-read
cache leases (anti-stampede)