Zero to System Design
The fundamentals, in order. Start here if system design is new to you. Each part builds on the last.
Every concept I explain, one topic at a time. Follow a series from page one, or search for the one idea you came for.
A series walks you through one subject in order, part by part. Every part is also a topic on the map below, so you can read any of them on its own.
The fundamentals, in order. Start here if system design is new to you. Each part builds on the last.
System design terms explained simply, one letter at a time. Short, plain-English guides to the words you hear in design reviews and interviews, from API to ZooKeeper, each with pictures and everyday examples. Read them in order or jump to any letter.
Every app you use talks to other software through APIs. Here is what an API really is, how a request and response work, and why APIs are the front door of every system design.
A system is only as fast as its slowest step. Here is what a bottleneck is, how to spot one with simple measurements, and why fixing it usually moves the problem somewhere else.
A CDN keeps copies of your images, videos and pages on servers close to your users, so they don't wait for a trip across the world. Here is how it works, what it caches, and what it can't do.
DNS is the internet's phone book. It turns names like kagitha.com into the numbers computers use to find each other. Here is how a lookup works, why caching makes it fast, and how big systems use DNS to route traffic.
When a server dies, failover switches work to a backup so users barely notice. Here is how failover works, the two common setups, and the traps that make it harder than it looks.
An API gateway is the single front door to many backend services. It routes each request to the right service and handles sign-in checks, rate limits and logging in one place. Here is how it works and when you need one.
Networks fail and requests get retried, so the same request often arrives twice. Idempotency means the second time changes nothing. Here is what it means, which HTTP methods have it, and how idempotency keys stop double payments.
A JWT is a signed pass that proves who you are, so a server can trust a request without looking you up every time. Here is what is inside one, how the signature works, and the mistakes that make JWTs unsafe.
A key-value store saves data as pairs, a key and its value, like a giant dictionary. That simplicity makes it extremely fast and easy to scale. Here is how it works, where Redis and DynamoDB fit, and when not to use one.
Latency is how long one request takes, from asking to getting the answer. Here is where that time goes, why engineers measure p95 and p99 instead of the average, and the simple ways to cut it.
NoSQL is a family of databases that don't store data in fixed tables. Here are the four main kinds, what they're good at, what you give up, and a simple way to choose between SQL and NoSQL.
Object storage keeps files as objects in huge buckets, each with a unique key and some labels. It's cheap, nearly endless and very durable, which is why photos, videos and backups live there. Here is how it works and when to use it.
A proxy is a middleman that passes requests on your behalf. A forward proxy speaks for the clients; a reverse proxy speaks for the servers. Here is the difference, what each is used for, and where NGINX fits.
A message queue lets one part of a system drop off work and move on, while another part picks it up when it's ready. Here is how producers, consumers and acknowledgements work, and why queues make systems calmer under load.
Throughput is how much work a system finishes per second. Here is how it's measured (RPS, QPS, MB/s), how it relates to latency, why systems slow down sharply near their limit, and the main ways to raise it.
99.9% uptime sounds perfect, but it still allows almost nine hours of downtime a year. Here is what uptime and availability mean, how the 'nines' translate into real minutes, and how SLIs, SLOs, SLAs and error budgets fit together.
Once apps depend on your API, changing it can break them overnight. API versioning lets old and new clients live side by side. Here is what counts as a breaking change, the common ways to version, and how to retire an old version politely.
A webhook is a reverse API call: instead of you asking 'has anything happened yet?', the other system calls you the moment it does. Here is how webhooks work, why they beat polling, and how to receive them safely.
The scale cube gives three ways to grow a system. The X axis clones the whole app, the Y axis splits it by function, and the Z axis splits it by customer or data. Here is what each axis means and when to reach for it.
YAGNI is a simple rule from software engineering: don't build things until you actually need them. Here is where it comes from, why over-engineering is so tempting in system design, and the few decisions you should still plan ahead for.
When many servers must agree on who's in charge, who's alive and what the settings are, they need a trusted referee. Apache ZooKeeper is that referee. Here is what it does, how leader election works, and where etcd fits today.
When a service you depend on starts failing, calling it again and again only makes things worse. A circuit breaker notices the failures, stops the calls for a while, and then carefully tries again. Here is how it works, its three states, and how to tune it.
Partitioning means splitting a big pile of data into smaller pieces so each piece is quicker to work with. Here are the two ways to split (by rows and by columns), the common partitioning schemes, and how partitioning relates to sharding.
When one service needs another, does it wait? Does its thread wait? Does it even know who is listening? Three simple questions, three communication models, and how to pick the right one for each part of your system.
Four popular ways for software to talk, each built for a different job. Learn how REST, gRPC, GraphQL and WebSockets work, where each one shines, where each one breaks, and how real systems use all four together.
Networks lose messages and repeat them. So every message system has to choose what goes wrong instead: lose a message, or deliver it twice. Learn the three delivery guarantees, why "exactly-once" is not what it sounds like, and how idempotency saves you.
Five networking terms every developer hears in system design talks and interviews, explained in plain English: duplex, multiplexing, head-of-line blocking, bidirectional streaming and QUIC. Plus which protocols support what, and where each one sits: HTTP, TCP or UDP.
HTTP/1.1, HTTP/2, HTTP/3, WebSocket, gRPC and RSocket are all interaction protocols. They decide how two systems talk, while TCP and QUIC only move the bytes. Learn what each one adds, why REST and Protobuf are not on the list, and the simple rule for when to move off REST.
You've heard of WebSocket. But have you heard of RSocket? It's a protocol that gives a live connection real rules on top. Here are its four ways to talk, the frames behind each one, and how the receiver gets to say "slow down".
One feature, three different minds. How a junior developer, a senior engineer and an architect each approach the same problem, and the habits that take you from one to the next.
It isn't memorising Kafka, Redis and Kubernetes. System design is how you turn a vague idea into a working system, by asking the right questions, choosing trade-offs on purpose and planning for failure from day one.
Requirements are not paperwork. They are the numbers that decide your architecture. Learn the difference between functional and non-functional requirements, how to make vague words measurable, and what SLIs, SLOs and SLAs really mean.
How many requests per second? How much storage? How many servers? Learn to answer in five minutes with simple maths, and let the numbers, not buzzwords, pick your design.
There is no best database, only the right one for a job. Learn the six main database types, what each one is good and bad at, and a simple way to choose: start with PostgreSQL and Redis, and add others only when an access pattern demands it.
Picking a database is half the job. The other half is the shape of your data. Learn when to store each fact once and when to copy it, why order history needs snapshots, how analytics data is shaped differently, and why NoSQL schemas start from your queries.
A cache keeps a copy of slow-to-get data somewhere fast, so you don't fetch it again and again. Learn how a cache hit and miss work, where caches live, the one trade-off behind every cache, and the four ways a cache can hurt you.
Every cache has to answer three questions: when does data go into it, where do writes go first, and who keeps it in step with the database? The four caching strategies are four different answers. Learn how each one works, when to use it, and the bugs that come with it.
A cache is small and data keeps changing. Eviction decides what to throw out when memory is full. Invalidation removes data that's no longer true. Learn LRU, LFU, FIFO and TTL, the four ways to invalidate a cache, and how to stop a thundering herd from flattening your database.
Every server, network and database will fail one day. Good systems are not the ones that never fail, but the ones that fail in small, safe ways. Learn how to fail fast with timeouts, find and remove single points of failure, choose active-passive or active-active failover, and degrade gracefully.
Failures will happen. Resilience patterns decide whether they stay small. Learn the five patterns every backend uses: timeouts, the circuit breaker, retries with exponential backoff and jitter, the bulkhead, and idempotency, and how they fit together.
Resilience patterns handle a slow service. Disaster recovery handles losing a whole data centre, a corrupted database or a deleted table. Learn RPO and RTO, the kinds of backup, why backups and replication are not the same thing, and the four DR strategies from backup-and-restore to active-active.
Messaging lets services talk without waiting for each other. Learn what a message queue is, the three messaging models (queue, pub/sub and stream), when to pick Kafka, RabbitMQ or Redis, and how to handle lost, duplicate, out-of-order and poison messages.
In an event-driven system, services stop telling each other what to do and start announcing what happened. Learn events vs commands, how to design a good event, the transactional outbox pattern, choreography vs orchestration, and how to deal with duplicates, ordering and changing schemas.
Most databases keep only the latest state and quietly throw away how it got there. Event sourcing keeps every change as an event and builds the current state from them. Learn how event sourcing works, snapshots, CQRS projections, handling concurrency and GDPR, and when it's worth the extra complexity.
Keep copies of your data on several machines and you survive crashes, serve users nearby and spread reads. But copies drift apart. Learn the three replication models, sync vs async, failover, write conflicts and quorums, and what each one costs.
When data lives on several replicas, a read might not see the latest write. Consistency models are the promises a system makes about that. Learn strong consistency, eventual consistency and the useful ones in between (causal, read-your-writes, monotonic reads) and how to pick per feature.
The CAP theorem is famous and often misquoted. The idea itself is short: when the network between your servers breaks, each side must either refuse requests or risk giving wrong answers. Learn what C, A and P really mean, why 'pick 2 of 3' is misleading, CP vs AP with real examples, and the speed-vs-accuracy trade-off you face even when the network is fine.
A load balancer spreads requests across many servers so no single one gets crushed, and quietly steps around the ones that break. Learn how load balancers work, round robin vs least connections, health checks, sticky sessions, Layer 4 vs Layer 7, and how load balancing fails.
A load balancer spreads traffic out, but it can't make more of it fit. When too many requests arrive, you need traffic control. Learn the five tools that keep a system alive under pressure: rate limiting, throttling, backpressure, load shedding and queues, and when to use each.
When production breaks, you need to know what failed, where, when, why and for whom. Observability is how a system answers those questions. Learn the three pillars, logs, metrics and distributed tracing, plus correlation IDs, percentiles, the golden signals, health checks and alerts people don't ignore.
Most outages start with a change. A good deployment strategy limits how many users a bad release can hurt and lets you undo it in seconds. Learn rolling, blue-green and canary deployments, why deploy is not the same as release, and how to change a database without downtime.
Security isn't a feature you add at the end. Learn the CIA triad, the difference between authentication and authorization, sessions vs JWT, what OAuth 2.0 and OpenID Connect are for, the four attacks every web app must stop, and how to protect against DDoS and leaked secrets.
When one database server runs out of room, you can buy a bigger machine or spread the data over many. Learn what each really costs, the difference between partitioning and sharding, the order most systems grow in, and what you give up the day you shard.
Once you shard, every row needs an address. Learn the four ways to decide which shard data lives on, why plain hash-mod-N hurts the day you add a shard, how consistent hashing and logical shards fix it, and how to choose a shard key you won't regret.
Shards never stay balanced. Data grows unevenly, one celebrity floods a single shard, a machine dies. Learn how to move data between live shards without downtime or lost writes, how to find and cool down hotspots, and why chasing perfect balance makes things worse.
Microservices are not an upgrade from a monolith. They are a trade. Learn what each style really is, what each one costs, and why team size matters more than traffic when you choose.
The moment your system runs on more than one machine, calls can fail halfway, time stops being reliable, and "did it work?" sometimes has no answer. Here is what changes, and the handful of ideas that keep you safe.