Module 7

Real-World Case Studies

Apply everything you've learned to design real systems: Twitter, Uber, Netflix, and WhatsApp - tackling the challenges at massive scale.

0%

Twitter Architecture Overview

High-level architecture showing client-side, API layer, and backend services.

Design a social media platform like Twitter with posts, follows, and timeline.

Functional Requirements:

Post tweets (280 chars, images, videos)
Follow/unfollow users
View home timeline (followed users' tweets)
Search tweets and users
Like, retweet, reply

Non-Functional Requirements:

300M+ daily active users
High read-to-write ratio (1000:1)
Low latency timeline (<500ms)
Eventually consistent (acceptable for social)

Capacity Estimation:

300M DAU × 10 views/day = 3B timeline loads
300M DAU × 2 tweets/day = 600M tweets/day
Tweet size ≈ 500 bytes → 300GB/day

Key Design Decisions:

Timeline Generation:

Fan-out on write: Pre-compute timelines
Fan-out on read: Compute on demand

Hybrid approach:

Celebrities → Fan-out on read
Regular users → Fan-out on write

Database Choices:

Users: PostgreSQL (relational, ACID)
Tweets: Cassandra (high write throughput)
Timeline Cache: Redis (fast reads)
Search: Elasticsearch

Twitter High-Level Architecture

Hover over components to highlight connections

ClientsCDNAPI GatewayTweet ServiceUser ServiceTimeline ServiceSearchCassandraPostgreSQLRedis CacheElasticsearchFrontendServicesData

Interactive: Fan-out strategies

User ACache 1Cache 2Cache 3Pre-computedtimelines

Tweets pre-pushed to follower caches (good for normal users)

🎉 Congratulations!

You've completed the System Design course. Now practice in the Playground!

Open Playground →