Shelves / System Design
Software Engineering · Volume 12
System Design
Part XII of the Software Engineering roadmap, written out as a textbook that starts from zero. The opening chapter assumes you have built applications but never designed a system, and works one small design end to end, from requirements and numbers to a measured single server and the limits that force it to grow. From there: requirements, estimation, the building blocks, scaling, availability, caching, databases, messaging, consistency, reliability patterns, events, APIs, multi-tenancy and global systems, then complete case studies. Every chapter opens with a plain-language Start here section and a six-level How deep to go ladder, and ends with a lab of real, measured experiments (requirements as executable checks, the latency hierarchy on real hardware, HAProxy algorithms and failover, linear and retrograde scaling, etcd leader loss and quorum loss, cache skew and stampedes, read-your-writes on a replica, NATS redelivery and deduplication, write skew and lost updates in PostgreSQL, retry amplification, the transactional outbox, keyset pagination, row-level security, and the cost of a synchronous second region) and a revision sheet with a quiz. A final chapter of eight projects designs and proves the tiffin centre end to end.
Two ways to read this book
Every chapter has the same shape: Start here (first principles, plain language, small verified examples) → How deep to go (what each mastery level needs) → full-depth sections → Lab (experiments with real measured output) → Revision sheet (key ideas, numbers to remember, pitfalls, glossary, quiz).
How to use this book
- Read one topic at a time. Each topic heading has a Done tick. Tick it only when you can explain the idea aloud without looking, which is roughly mastery level L2–L3 below.
- Run the code. Every comparison block has tabs for each language; type the example out in at least two of them.
- Take the chapter quiz at the end. A score of 80% or more counts as passed. Wrong answers show the explanation, so re-read that topic and untick it if needed.
- Revisit after a delay. The roadmap's loop applies: recall, explain, implement without notes, break it, measure it.
Mastery levels
Languages used throughout
Status as of October 2026: PostgreSQL 18 (September 2025) is current; Apache Kafka 4.x runs on KRaft only (no ZooKeeper), and Kafka 4.2 (February 2026) made queues (share groups, KIP-932) production-ready; Redis 8 is again open source under AGPLv3 alongside the Linux Foundation fork Valkey; Amazon S3 has been strongly read-after-write consistent since 2020. The numbers in estimation examples are illustrative orders of magnitude, so recalculate them for your own hardware and providers.
Contents
- SC·00Start Here: Your First System DesignFor readers who have built applications but never designed a system: what system design is, one small design worked end to end (the tiffin centre's…5 min
- SC·121Requirement AnalysisThe step that decides whether a design succeeds: why requirements come before boxes, a repeatable design method, discovering users, workflows, core…20 min
- SC·122EstimationBack-of-envelope calculation as an engineering skill: powers of two and ten, latency numbers every engineer should know, daily and peak QPS from user…21 min
- SC·123Fundamental Building BlocksThe components every architecture is assembled from, each explained by what problem it solves, how it works inside, its key design choices and…20 min
- SC·124ScalingHow systems grow: scalability defined (and Amdahl's and the Universal Scalability Laws), vertical versus horizontal scaling, stateless services and…23 min
- SC·125AvailabilityKeeping systems serving through failures: availability defined and measured, the maths of serial and parallel components, redundancy at every layer…19 min
- SC·126Caching ArchitectureCaching in depth: why caches work (locality and skew), where to cache (client, CDN, gateway, in-process, distributed, database), the patterns…24 min
- SC·127Database ArchitectureStructuring the data tier for scale and evolution: choosing data models, read replicas and replication lag handling, table partitioning (range, list…21 min
- SC·128Messaging ArchitectureDesigning with asynchronous messages: why decouple, queues versus streams in depth, point-to-point, pub/sub and fan-out topologies, consumer groups…21 min
- SC·129Consistency ArchitectureChoosing and implementing consistency per piece of data: the spectrum from linearizability through causal to eventual consistency, where strong…21 min
- SC·130Reliability PatternsThe patterns that stop failures from spreading: why failures cascade, timeouts and deadline propagation, retries done safely (idempotency, budgets…24 min
- SC·131Event-Driven ArchitectureBuilding systems around events: events versus commands versus queries, notification versus event-carried state transfer, designing event schemas and…25 min
- SC·132API ArchitectureChoosing and designing the interfaces between clients and services: REST resource design (methods, status codes, pagination, filtering, errors with…22 min
- SC·133Multi-TenancyDesigning SaaS systems that serve many customers safely and economically: tenancy models (shared database and schema with tenant IDs and row-level…19 min
- SC·134Global SystemsDesigning for users and failures across the planet: why go global (latency, availability, residency), the physics of distance, geo-routing with DNS…17 min
- SC·CSCase Studies: Putting It All TogetherFive complete designs worked through with the method from chapter 121 (requirements, estimates, API and data model, high-level architecture, deep…19 min
- SC·135System Design ProjectsEight build-it-yourself projects that turn the tiffin centre into a measured, defensible system design: requirements as executable checks, a capacity…7 min