System design flashcards
Plan apps that stay fast and reliable as users grow.
Beginner friendly, starts from zero
0
System design at a glance
System design is planning how the parts of a big app fit together so it stays fast and reliable as it grows.
Like a food stall growing into a busy restaurant: more cooks, a host to seat guests, a shelf of ready dishes and a rail of order tickets.
Words you will meet
- Server
- A computer that waits for requests and sends back answers
- Database
- Where the app's data is stored safely
- Cache
- Fast memory that keeps copies of popular answers
- Load balancer
- The part that shares requests between servers
- Latency
- How long one request takes
- Availability
- How often the system works when people need it
- Queue
- A waiting line of jobs for workers to pick up
- Redundancy
- Keeping spare parts ready so one failure does not stop everything
The steps
- 1. Start from zero (12 cards): What system design is, the parts of a big app in plain words, and how to sketch your first design.
- 2. Core basics (16 cards): Requirements, latency, scaling, load balancers, caches, CDNs, databases, indexes and estimates.
- 3. Next steps (17 cards): Replication, sharding, consistent hashing, CAP, queues, caching patterns, rate limits and races.
- 4. Go deeper (17 cards): Microservices, events, outbox, sagas, resilience, observability, SLOs and classic designs.
All 12 cards in Start from zero
- What is system design, in one plain sentence?
- System design is planning how the parts of a big app fit together, so it stays fast and keeps working when millions of people use it at once.
- What problem does system design solve?
- An app on one computer is fine for a few friends. When thousands arrive at once it slows down, crashes or loses data. System design plans for that crowd before it hurts.
- Where do you already meet system design in daily life?
- Booking train tickets the minute sales open, a festival sale on a shopping app, or a cricket final streamed to millions: each only works because someone designed for the rush.
- What everyday thing is system design like?
- A food stall growing into a busy restaurant: more cooks (servers), a host who seats each guest (load balancer), a shelf of ready dishes (cache) and a rail of order tickets (queue).
- What are a client, a server, a request and a response?
- A client is the app or browser on your phone. A server is a computer that waits for requests, messages asking for something, and sends back a response.
- What are a database and a cache?
- A database stores the app's data safely, like users and orders. A cache keeps copies of popular answers in fast memory, so the database is asked less often.
- What are scaling and a load balancer?
- Scaling means growing to handle more users: a bigger machine, or more machines. A load balancer sits in front and hands each request to a server that is free and healthy.
- What are latency and throughput?
- Latency is how long one request takes, often in ms (milliseconds, thousandths of a second). Throughput is how many requests the system handles each second.
- What are availability, a single point of failure and redundancy?
- Availability is how often the system works when needed, like 99.9 percent. A single point of failure is one part whose breakdown stops everything; redundancy means keeping a spare ready.
- What are an API, a queue and a worker?
- An API is the set of web addresses apps call to ask a server for things. A queue is a waiting line of jobs, and a worker is a program that takes jobs from it one by one in the background.
- What do you need, and what is your first tiny win?
- Nothing to install: pen and paper is enough. Draw any app you use as boxes and arrows: the client asks the server, and the server reads the database. That sketch is a system design.
- What will you be able to do after this topic?
- Sketch a design for an app with millions of users, pick the right database and cache, find what can break, estimate how many servers you need, and explain your trade-offs in an interview.
System design cheatsheet
Latency numbers (rough)
L1 cache reference~1 nsMain memory reference~100 nsRead 1 MB sequentially from memory~3 to 10 usSSD random read~16 to 100 usSame-zone network round trip~0.5 msRedis GET over the network~0.5 to 1 msIndexed DB query~1 to 10 msCross-continent round trip~100 to 200 ms
Availability
99% (two nines)~7.3 h down / month99.9% (three nines)~43.8 min / month99.95%~21.9 min / month99.99% (four nines)~4.4 min / monthSerial deps: A x B99.9% x 99.9% = 99.8%Parallel copies: 1 - (1-A)^299% each -> 99.99% together
Building blocks
Load balancer (L4 / L7)Spread traffic, health checksCDNCache static and edge content near usersRedis / MemcachedIn-memory cache, counters, locksRead replicaScale reads, standby for failoverShardsScale writes and storage by keyQueue / log (SQS, Kafka)Decouple, buffer, retryObject storageFiles, media, backupsSearch indexFull-text and faceted queries
Trade-offs
Consistency vs availabilityUnder partition (CAP)Latency vs consistencyEven without partition (PACELC)Normalise vs denormaliseWrite simplicity vs read speedFan-out on write vs readFast reads vs cheap writesPush vs pull updatesFreshness vs connection costMonolith vs microservicesSimplicity vs independent scalingSync call vs async eventSimple flow vs resilience
Quick maths
1 day~86,400 s (use 10^5)1M requests/day~12 req/s averagePeak~3 to 5x average1 KB x 1B rows~1 TB2^10 / 2^20 / 2^30 / 2^40Thousand, million, billion, trillionbase62, 7 chars~3.5 trillion ids1 Gbps~125 MB/s