Frontend Labs
⋯

68. Cheat Sheets & Further Reading

68.1 Problem → pattern map

If the problem has... Reach for...
Read-heavy, latency-sensitive Cache-aside + CDN + read replicas; precomputation
Write-heavy, append-only LSM / wide-column store, log (Kafka), batching
Contended counter or inventory Atomic conditional updates, sharded counters, reservations with TTL
Massive fan-out Hybrid push/pull, async workers, skip inactive users
Exactly-once side effects Idempotency keys + outbox + idempotent consumers
Multi-step business process Saga with orchestration (workflow engine)
Global users CDN, home-region pattern, async cross-region replication
Blast radius / multi-tenant SaaS Cells, shuffle sharding, tiered tenancy
Real-time bidirectional WebSocket gateways + session registry
Proximity / geo Geohash / H3 / S2, in-memory geo index sharded by region
Top-K / trending Streaming windows + heap; Count-Min Sketch when approximate is OK
Text search Inverted index fed by CDC; never the source of truth
Huge spikes (on-sales, launches) Virtual waiting room, admission control, load shedding
Dedupe at scale Bloom filters, content hashing, unique constraints
Leader / lock / config etcd / ZooKeeper, leases + fencing tokens
Analytics CDC → lake/warehouse; never on the OLTP primary

68.2 Numbers to have ready

86,400 s/day ≈ 10^5          1M/day ≈ 12/s          1B/day ≈ 12k/s
Memory 100 ns · SSD 100 µs · DC round trip 0.5 ms · cross-continent 100-150 ms
99.9% = 8.8 h/yr · 99.99% = 53 min/yr · 99.999% = 5 min/yr
Utilization 80% → ~5x queueing latency; 90% → ~10x
Fan-out to 100 with 1% slow each → 63% of requests slow
base62^7 ≈ 3.5 trillion · Snowflake ID = 41b time + 10b machine + 12b sequence

68.3 The final checklist (run it in the last 5 minutes of every interview)

  • Did I tie the design to the business outcome and say what we're optimizing for?
  • Are the NFRs quantified and does the design meet them?
  • Is the partition key stated, and are hotspots handled?
  • Is the consistency choice explicit for each critical operation?
  • What happens when each component fails? What's the blast radius?
  • What breaks first at 10× load?
  • What does it cost, and what's the biggest cost lever?
  • How do we migrate to it and roll it out safely?
  • How do we observe it (SLIs/SLOs) and who owns it?
  • Which decisions are one-way doors?

68.4 Further reading

Books

  • Martin Kleppmann, Designing Data-Intensive Applications. If you read only one book, read this one.
  • Google, Site Reliability Engineering and The Site Reliability Workbook (free online): SLOs, error budgets, alerting.
  • Alex Xu (and Sahn Lam), System Design Interview, Vol. 1 & 2: interview-shaped case studies.
  • Will Larson, Staff Engineer and An Elegant Puzzle: the Staff+ and EM layer.
  • Matthew Skelton & Manuel Pais, Team Topologies: Conway's Law put into practice.
  • Neil Gunther / Mor Harchol-Balter on queueing theory, if you want the math behind §22.

Papers (each is the origin of a pattern in this guide)

  • The Google File System (2003); MapReduce (2004); Bigtable (2006)
  • Dynamo: Amazon's Highly Available Key-value Store (2007)
  • The Chubby Lock Service (2006); ZooKeeper (2010)
  • Spanner: Google's Globally-Distributed Database (2012)
  • In Search of an Understandable Consensus Algorithm (Raft) (2014)
  • Kafka: a Distributed Messaging System for Log Processing (2011)
  • Scaling Memcache at Facebook (2013); TAO: Facebook's Distributed Data Store for the Social Graph (2013)
  • The Tail at Scale, Dean & Barroso (2013)
  • Large-scale cluster management at Google with Borg (2015)
  • Zanzibar: Google's Consistent, Global Authorization System (2019)
  • Metastable Failures in Distributed Systems, Bronson et al. (2021)
  • Gorilla: A Fast, Scalable, In-Memory Time Series Database (2015)
  • Mercator: A Scalable, Extensible Web Crawler (1999)

Engineering blogs and series

  • Amazon Builders' Library: timeouts/retries/jitter, shuffle sharding, static stability, cell-based architecture
  • Google Cloud Architecture Center; Azure Architecture Center (good for Microsoft loops: reference architectures and cloud design patterns)
  • Netflix, Uber, Discord, Stripe, Meta, Dropbox, Cloudflare, and Slack engineering blogs: real architectures with real constraints
  • Jepsen analyses (jepsen.io): what consistency claims actually hold under partitions

Elsewhere in this wiki


Generated from real-life-system-design-guide.md · 8 Oct 2026 16:36