An open-source guide
Learn how to design large-scale systems.
Concepts, trade-offs and worked interview solutions, in a form you can actually read. Everything is a trade-off; this is where to learn them.
Interview prep
Pick your timeline
You do not need to know everything. Match the depth to the time you have.
Short timeline
Aim for breadth. Know what each building block does and when you would reach for it.
- Skim the topics
- Solve a few questions
- Learn the 4-step approach
Medium timeline
Breadth plus some depth. Practise on many questions and read about real systems.
- All of the above
- Work through many solutions
- Read real-world architectures
Long timeline
Go deep in the areas that matter for the roles and companies you are targeting.
- All of the above
- Solve most questions
- Study company engineering blogs
Learn
The map of system design
Ordered the way you meet these problems as a system grows.
Start here
Fundamentals
Performance vs scalability
Slow for one user, or slow only under load? Two different problems.
1 min read05Latency vs throughput
Time to do one thing versus how many things you can do per second.
2 min read06Availability vs consistency
The CAP theorem and why a network partition forces a choice.
1 min read07Consistency patterns
Weak, eventual and strong consistency, and where each one fits.
1 min read08Availability patterns
Fail-over, replication and what the nines really mean.
2 min readNetwork & edge
Domain name system
How names become addresses, and what can go wrong on the way.
1 min read10Content delivery network
Serve content from a location near the user: push vs pull CDNs.
2 min read11Load balancer
Spread requests across servers; layer 4 vs layer 7; horizontal scaling.
4 min read12Reverse proxy
A front door for your servers, and how it differs from a load balancer.
1 min readApplication
Application layer
Separate the web tier from the app tier: microservices and service discovery.
1 min read14Asynchronism
Message queues, task queues and back pressure.
2 min read15Communication
HTTP, TCP, UDP, RPC and REST, and when to reach for each.
7 min read16Security
The essentials: encryption, sanitising input, least privilege.
3 min read17Observability
Logs, metrics and traces, what to measure, and how SLOs and error budgets decide when to page someone.
8 min readData
Labs
Learn by poking at it
Simulations and calculators: size a system, break a cache, partition a database.
From one user to millions
Follow one product as it grows, nine stages at a time, and see which problem each building block solves.
4 min readLab 02Capacity estimator
Turn users and request sizes into QPS, storage, bandwidth and server counts.
2 min readLab 03Consistent hashing
Add and remove nodes on a hash ring and see how few keys have to move.
2 min readLab 04Cache eviction
Replay the same traffic through LRU, LFU, FIFO and random eviction.
3 min readLab 05Load balancing
Compare round robin, least connections, hashing and weighted routing under load.
3 min readLab 06The load curve
See why response time explodes near full utilisation, and how adding servers moves you back.
3 min readLab 07Replication
Write to a primary, read from replicas, then crash the primary and count what is lost.
3 min readLab 08Sharding strategies
Split 600 users across shards by range, hash or lookup table and see which one tips over.
2 min readLab 09Unique ID generation
Make IDs with a counter, ticket servers, UUIDs and Snowflake, then break the clock, the database and the configuration.
8 min readLab 10Queues and back pressure
Make a producer faster than its consumers and watch the queue fill, drop, or push back.
2 min readLab 11Rate limiting
Send the same requests through a fixed window, a sliding log, a sliding counter, a token bucket and a leaky bucket.
5 min readLab 12Idempotency and retries
Fail a payment at every point and see when a retry charges twice, then watch 1,000 clients retry after an outage.
7 min readLab 13DNS lookup
Walk a lookup from browser to authoritative server and see how caches skip the walk.
3 min readLab 14CDN edge caching
Request a file from three continents with no CDN, a pull CDN and a push CDN.
3 min readLab 15TCP vs UDP
Send the same packets over a lossy link and compare what arrives, and when.
3 min readLab 16Quorum reads and writes
Choose N, W and R and see when a read is guaranteed to see the latest write, and how many failures each survives.
2 min readLab 17CAP in practice
Partition a three-node store and watch it choose between consistency and availability.
1 min readPractice
Worked solutions
Diagrams, back-of-the-envelope maths and the reasoning behind each choice.

Design Mint.com
Pull in transactions from many banks, categorise spending and send budget alerts.
Intermediate10 min read
Design Pastebin.com (or Bit.ly)
A URL-shortening and text-sharing service: hashing, expiry and read-heavy traffic.
Starter8 min read
Design a key-value cache to save the results of the most recent web server queries
A key-value store that fronts a search engine and evicts with LRU.
Intermediate6 min read
Design Amazon's sales rank by category feature
Compute the best-selling products per category from a stream of orders.
Intermediate7 min read
Design a system that scales to millions of users on AWS
Grow from one box to millions of users, one bottleneck at a time.
Advanced10 min read
Design the data structures for a social network
Shortest path and friend-of-friend queries over a very large social graph.
Intermediate7 min read
Design the Twitter timeline and search
Timeline fan-out, a home feed and search for hundreds of millions of users.
Advanced9 min read
Design a web crawler
Crawl billions of links without repeating work, then rank and serve the results.
Intermediate8 min read