Skip to content

Case study: Twitter home timeline

Serve home timelines at hundreds of thousands of reads per second with hybrid fan-out: in-memory timelines for most authors, read-time merge for celebrities.

30 min9 steps

By the end you can
  • Derive the fan-out write rate and timeline memory from published Twitter numbers
  • Design the hybrid read path that merges precomputed timelines with celebrity tweets
  • Explain how time-ordered IDs make merging and pagination cheap
  • Predict how cache loss, slow fan-out and traffic spikes affect reads, writes and freshness

Requirements

Home timeline

  • Post tweets; follow graph; cursor pagination

Bounded reads

  • Fresh timelines; celebrity fan-out must not delay everyone

What is the right consistency target for the home timeline?

Answer this step to continue.