Cheat sheet · Systems and cloud
System design cheat sheet
Numbers to remember, scaling patterns, trade-offs and a step-by-step plan for design interviews.
- Sections
- 6
- Items
- 30
- Area
- Systems and cloud
- Download
- PNG, PDF
Cheat sheet
System design
Numbers to remember, scaling patterns, trade-offs and a step-by-step plan for design interviews.
Numbers worth knowing
Memory read- About 100 nanoseconds
SSD read- About 100 microseconds
Same-data-centre round trip- About 0.5 milliseconds
Disk seek (spinning)- About 10 milliseconds
Round trip across continents- About 150 milliseconds
1 day- About 86,400 seconds, or roughly 100,000
1 million requests a day- About 12 requests a second
These are rough orders of magnitude. They are for estimates, not exact values.
Availability
99.9% (three nines)- About 8.8 hours of downtime a year
99.99%- About 53 minutes a year
99.999%- About 5 minutes a year
Scaling
Vertical- A bigger machine. Simple, but it has a limit
Horizontal- More machines behind a load balancer
Load balancing- Round robin, least connections, or hash of the user
Caching- Keep hot data close: browser, CDN, application, database
CDN- Serve static files from a place near the user
Queue- Do slow work later so the request returns fast
Databases
Replication- Copies of the data: read scale and failover
Sharding- Split data across machines by a key
SQL- Strong structure, joins, transactions
NoSQL- Flexible shape or huge scale; fewer joins
Index- Faster reads, slower writes
Trade-offs
CAP- During a network split, choose consistency or availability
Strong vs eventual consistency- Always the latest value vs the same value after a short wait
Latency vs throughput- Time for one request vs how many per second
Push vs pull- Send updates to clients vs clients ask for them
Interview steps
1. Clarify- Features, users, scale, what is out of scope
2. Estimate- Requests per second, data size, bandwidth
3. Draw the big picture- Clients, API, services, database, cache, queue
4. Go deep- The hardest part: data model, scaling, failures
5. Review- Bottlenecks, single points of failure, monitoring
Remember
- Say your assumptions out loud and name the trade-off of every choice. That is what is being graded.
- Start simple and add a part only when you can say which problem it solves.
Learn it properly
A cheat sheet helps you remember. These lessons explain the ideas step by step, with examples.