Twitter System Design (Timeline, Search & Scale)

Design a social media platform like Twitter that allows users to post tweets, follow other users, and view timelines.

Constraints

Functional

Post tweets (up to 280 chars), follow/unfollow, home timeline (tweets from followed users), user timeline, like/retweet, search tweets and users

Non-functional

500M users, 200M DAU, timeline < 200ms, 99.99% uptime, eventual consistency for timelines

Scale

500M users, 200M DAU; ~1B tweets/day, peak ~12K/s; ~4B timeline reads/day, peak ~50K/s; ~300 GB/day, ~550 TB over 5 years

Stages ahead

1Requirement Analysis
2API Design
3High-Level Design
4HLD Extensions
5Trade-offs