Skip to content
StackDecode
System Design
20. System Design Case StudiesAnimated

News Feed Generation System

Build a personalised feed.

The idea

Fan-out on write precomputes feeds; fan-out on read builds on demand; hybrids handle celebrities.

Watch it work

Press play, pause, or step through. Some animations have settings you can change.

PostPost serviceFan-out queueFeed cacheRankerReader
  • client
  • gateway / proxy
  • service
  • cache
  • data store
  • queue / stream

Fan-out on write: push post ids to each follower's feed list.

step:
1/4
at:
Post
1/10

The green dot is a request moving through the system.

Step by step

  1. 1A user posts
  2. 2Fan out to follower feeds
  3. 3Feed service ranks
  4. 4Reader loads from cache

Where it is used

Social feeds.

Watch out for

Celebrity fan-out and ranking cost.

Related