System DesignVol. 12 · Part XII
0 / 0

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.

17 chapters◷ ~5 h to read ✓ 471 topics? 17 quizzes

Two ways to read this book

New to the subjectStart with the opening Start Here chapter and read chapters in order. In each chapter, read the Start here section, run its examples, answer Check yourself before opening the answers, and take the quiz. Read the deeper sections once the Start here quiz is easy; leave the hardest parts for a second pass. Build the projects in the final chapter as you go.
Experienced engineerSkip the opening chapter. In each chapter, read the Revision sheet at the end first and take its quiz; skim Start here; then use How deep to go to pick the internals sections and lab experiments that fill your gaps. Tick a topic only when you could teach it.

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

  1. 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.
  2. Run the code. Every comparison block has tabs for each language; type the example out in at least two of them.
  3. 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.
  4. Revisit after a delay. The roadmap's loop applies: recall, explain, implement without notes, break it, measure it.

Mastery levels

L1 RecognitionDefine it and identify it.
L2 WorkingUse it correctly in code or config.
L3 InternalsExplain why it works.
L4 DebuggingDiagnose failures and performance problems.
L5 DesignChoose among competing approaches.
L6 ProductionOperate it under scale, failure, security and cost.

Languages used throughout

requirements · NFRsestimationLB · gateway · CDNcache · DB · object storequeues · streams · CDCconsistency · resilienceREST · gRPC · GraphQL · WSmulti-tenant · multi-region

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

  1. 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
  2. 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
  3. 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
  4. 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
  5. SC·124ScalingHow systems grow: scalability defined (and Amdahl's and the Universal Scalability Laws), vertical versus horizontal scaling, stateless services and…23 min
  6. SC·125AvailabilityKeeping systems serving through failures: availability defined and measured, the maths of serial and parallel components, redundancy at every layer…19 min
  7. 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
  8. 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
  9. 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
  10. SC·129Consistency ArchitectureChoosing and implementing consistency per piece of data: the spectrum from linearizability through causal to eventual consistency, where strong…21 min
  11. SC·130Reliability PatternsThe patterns that stop failures from spreading: why failures cascade, timeouts and deadline propagation, retries done safely (idempotency, budgets…24 min
  12. SC·131Event-Driven ArchitectureBuilding systems around events: events versus commands versus queries, notification versus event-carried state transfer, designing event schemas and…25 min
  13. SC·132API ArchitectureChoosing and designing the interfaces between clients and services: REST resource design (methods, status codes, pagination, filtering, errors with…22 min
  14. 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
  15. 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
  16. 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
  17. 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