Part 5 of 6 | ← Part 4: Ethics & Safety | Part 6: Advanced Topics →
Case Study: Feed Ranking Architecture The following synthesizes public disclosures from major platforms (Meta, TikTok, YouTube, Twitter/X) into a representative architecture.
Request Flow sequenceDiagram participant Client participant Gateway participant Retrieval participant Ranking participant Reranking participant Collator Client->>Gateway: Feed request Gateway->>Retrieval: Get candidates (user_id, context) Retrieval-->>Gateway: 5000 candidates Gateway->>Ranking: Score candidates Ranking-->>Gateway: 500 scored items Gateway->>Reranking: Apply diversity, policy Reranking-->>Gateway: 100 items Gateway->>Collator: Mix organic + ads + notifications Collator-->>Gateway: 50 items Gateway-->>Client: Feed response (paginated) Component Details Component Implementation Retrieval Two-tower model (user/item embeddings) + graph-based (friends’ posts) + trending Ranking Multi-task DCN with 100+ features; outputs P(click), P(like), P(share), P(hide), E(watch_time) Re-ranking MMR for diversity; policy filters; creator frequency caps Feed Collator Interleaves organic posts, ads (from separate auction), and system notifications Latency Budget Stage Target Latency (P99) Feature fetch 10 ms Retrieval 30 ms Ranking (500 items) 50 ms Re-ranking 10 ms Total < 150 ms Caching, precomputation, and model optimization keep end-to-end latency within budget.
...