Lesson 11 of 15
37. Design a News Feed

37.10 What would you say in the last five minutes?

3 min read+10 XP

Step 6: Wrap-up (5 minutes)

  • Bottlenecks: fan-out writes (hybrid, skip inactive users, priority lanes, Chapter 22) and feed reads (cache of IDs, hydration from caches).
  • Single points of failure: none central; feed cache and posts are sharded and replicated; feeds can always be rebuilt by pulling.
  • Freshness: async fan-out within seconds for most posts; celebrity posts are always fresh because they're pulled.
  • Next with more time: ads blended into the ranking, video, "stories", privacy settings (who can see a post affects fan-out), and deletion (remove from feeds lazily: filter deleted IDs at hydration).

Memory code: "Precompute what's cheap, pull what's huge, rank what's left."