Practice: Design Twitter
Production-grade Twitter/X architecture built progressively across 6 stages: durable tweet write path, social graph, hybrid push/pull home-timeline fanout, ranking and search, engagement/notifications/moderation, and ads plus analytics — 25 components at the final stage, every stage sized for >2× headroom at 300K rps across 3 AZs. A teaching design inspired by Twitter's published engineering, not its internal architecture.
Build this system yourself on the canvas below. Add components, connect them, and run traffic simulations to see where your design holds up and where it breaks.
Functional requirements
- Users can create tweets, delete tweets, and view tweet details.
- Users can follow or unfollow other users.
- Users can view a home timeline of tweets from followed accounts.
- Users can like, reply, repost/retweet, and quote-tweet posts.
- Users can search tweets by keyword, hashtag, and user.
- Users can receive notifications for engagement and relevant social events.
- The platform should support trending topics and basic recommendation/ranking features.
- The system should support ad or sponsored tweet insertion in timelines.
- The platform should support moderation workflows for spam, abuse, and policy violations.
Non-functional requirements
- Home timeline reads should remain low-latency under very high read-heavy traffic.
- Tweet-create write path should stay responsive even when fanout, indexing, or notifications are backlogged.
- The platform should degrade gracefully during downstream search, ranking, or notification failures.
- The design should support celebrity users, hot tweets, and bursty global events without collapsing caches or fanout systems.
- The system should provide strong observability for technical SLOs and product KPIs such as tweet impressions, timeline latency, and ranking quality.
- The platform should remain available during regional incidents with explicit RPO/RTO and safe rollout controls.