Fan-out on write (push)

Alice tweets. For each of Alice's followers, tweet appended to their pre-built timeline in Redis. Read-time = single fetch.

Advertisement

Fan-out on write (push)

Alice tweets. For each of Alice's followers, tweet appended to their pre-built timeline in Redis. Read-time = single fetch.

Advertisement

Fan-out on read (pull) for celebs

Celeb with 100M followers → push fan-out too expensive. Their tweets pulled at read time + merged into follower's timeline.

Hybrid model

Regular users: push. Celebs (~1K threshold): pull. Timeline reader merges both. Best of both worlds.

Ranking not chronological

Timeline reader passes candidates to ranker. ML model orders by predicted engagement. 'For You' feed.

Delivery guarantees

Push is eventually consistent. Deletes must undo fan-outs. Anomalies (missed pushes) reconciled by periodic backfill.