System Design

The System Design
Roadmap.

20 concepts across 4 phases, in the order that builds on itself — foundational building blocks first, then the distributed-systems ideas that trip most people up, then reliability and microservices patterns. Finish with 5 real-world architectures that put it all together. Progress is saved in this browser.

0 / 25 complete
Phase 1 Foundation — the building blocks everything else assumes you know
Load Balancer
Traffic Distribution

Round Robin, Weighted RR, Least Connections, IP Hash — how traffic gets spread across servers.

Caching
Latency Reduction

Cache capacity, eviction policy (LRU/LFU/FIFO), and how hit rate changes latency.

Database Design
Normalization

1NF → 2NF → 3NF with real tables, and the anomalies normalization actually fixes.

Database Indexing
Query Performance

Full table scan vs B-Tree traversal — the O(n) vs O(log n) difference, visually.

DB Replication
High Availability

Sync/Async/Semi-Sync replicas, replication lag, and failover.

Database Sharding
Horizontal Scaling

Hash, Range, or Directory sharding across shards — and what makes a shard "hot".

Phase 2 Distributed Systems — the ideas that separate mid-level from senior
Consistent Hashing
Distributed Routing

A virtual ring of servers where adding/removing one only remaps a minimal set of keys.

CAP Theorem
Distributed Trade-offs

Inject a network partition — watch CP systems reject reads while AP systems serve stale data.

Message Queues
Async Communication

Kafka vs RabbitMQ — producers, partitions, consumer groups, and lag.

Event-Driven Architecture
Decoupled Systems

Publish to a bus, watch subscribers react in parallel — vs request-response, side by side.

Distributed Locks
Concurrency Control

Services competing for a Redis lock with TTL — crash the holder, watch it transfer.

Distributed Transactions
Saga Pattern

A saga across Order → Payment → Inventory → Shipping, with automatic compensation on failure.

Phase 3 Reliability — the patterns you should bring up before anyone asks
Rate Limiter
Traffic Control

Token Bucket, Leaky Bucket, Fixed/Sliding Window — with a live 429 rejection counter.

Retries & Backoff
Fault Tolerance

No Retry vs Fixed vs Exponential vs Jitter — watch a thundering herd collapse into a smooth curve.

Circuit Breaker
Cascading Failure Prevention

Closed → Open → Half-Open, live, as failure rate crosses your threshold.

Idempotency
Safe Retries

Duplicate payment requests, with and without an idempotency key, side by side.

Phase 4 Microservices — production-grade architecture
API Gateway
Entry Point

Auth, rate limiting, caching, transform — one pipeline, inject failures to see 401/429/503.

Service Discovery
Dynamic Routing

Scale instances, kill one mid-flight, watch the registry route around the failure.

Authentication
JWT / OAuth 2.0

JWT, OAuth 2.0 Authorization Code, and Client Credentials — decode a token live.

Monitoring & Observability
Metrics / Logs / Traces

Inject error/latency spikes and memory leaks — watch alerts, logs, and traces respond.

Capstone — See It All Together
WhatsApp
Real-time Messaging

The most familiar domain — start here to see caching, queues, and replication as one system.

Instagram
Social Media Platform

Adds sharding and feed-ranking on top — the social graph makes fan-out non-trivial.

Netflix
Video Streaming

CDN-heavy at global scale — a different shape of problem than request/response APIs.

YouTube
Video Platform

Same streaming shape as Netflix, plus an ingestion/transcoding pipeline on the write path.

AI Agents
LLM Orchestration System

The newest and least "classic" architecture on the site — save it for last.