← All comparisons

Instagram Feed vs Twitter Home Timeline

Instagram Feed

Instagram Feed

Fan-out on write vs read, ranking, CDN.

Components (10)

  • Mobile Client
  • CDN
  • API Gateway
  • Feed Service
  • Post Service
  • Kafka
  • Fan-out Worker
  • Redis
  • Postgres
  • S3

Headline numbers

  • Posts / sec (avg)~3,000/sec
  • Feed read QPS~58,000/sec
  • Fan-out writes / sec~600,000/sec
Twitter Home Timeline

Twitter Home Timeline

Hybrid fan-out: push for most users, pull for celebrities, merged at read time.

Components (9)

  • Client
  • API Gateway
  • Timeline Service
  • Tweet Service
  • Kafka
  • Fan-out Worker
  • Redis
  • Tweet Store
  • Celebrity Tweet Cache

Headline numbers

  • Tweets / sec~870/sec avg, ~6,000 peak
  • Timeline read QPS~43,500/sec
  • Fan-out writes / sec (non-celebs)~87,000/sec

Key differences

Only in Instagram Feed
  • CDN
  • S3
In both
  • Client
  • Api Gateway
  • Service
  • Queue
  • Cache
  • Database
Only in Twitter Home Timeline
None.

Flow shape

Instagram Feed flows
  • Post a photo (fan-out on write)7 steps
  • Open feed (precomputed timeline)5 steps
  • Fan-out Worker is down7 steps
  • Timeline cache flushed (Redis restart)4 steps
Twitter Home Timeline flows
  • Normal user posts a tweet (fan-out on write)6 steps
  • Celebrity posts a tweet (skip fan-out)4 steps
  • Open home timeline (hybrid read)5 steps
  • Fan-out Worker is down6 steps
  • Celebrity cache cold-start5 steps