SysDesignPrep.com
Study guide 04 of 183

System design patterns cheat sheet

A one-page map of the patterns that solve recurring system design problems: scaling reads and writes, consistency, reliability, messaging, data processing, real-time, search and geo, security and operations, each with a one-line use and a link to the full guide.

Reading is half of it. See this used in a real interview: walk through Design a URL Shortener →

Most system design questions are combinations of a few dozen recurring problems, each with well-known solutions. This page lists them by problem, with a one-line reminder of when to use each pattern and a link to the guide that explains it properly. Use it to review before an interview, or to find what to read next.

Scaling reads

ProblemPatternGuide
Same data read over and overcache-aside with TTLscaching
Static or public content worldwideCDN with long-lived, versioned URLsCDN and edge
Database read loadread replicas, lag-aware routingscaling a relational database
Expensive queries per pagedenormalise, precompute read modelsdata modelling and denormalisation
Feeds and timelinesfan-out on write, pull for celebritiesfan-out on write vs read
One extremely hot keylocal cache, replicated keys, request coalescinghot keys and skew
Stale cache after updatesdelete on write, CDC invalidation, leasescache invalidation

Scaling writes and data

ProblemPatternGuide
Data or writes beyond one machineshard by a high-cardinality keysharding and partitioning
Adding nodes without reshuffling everythingconsistent hashingconsistent hashing
Very high write volumeLSM storage, batching, append-only logsstorage engines
Counting likes, views, clickssharded counters, stream aggregationcounting at scale
Metrics and events over timetime partitions, downsampling, TTLstime-series data
Large files and mediaobject storage, presigned uploadsmedia uploads and processing
Unique ids across machinesSnowflake-style or UUIDv7 idsunique ids, ordering and time

Consistency and correctness

ProblemPatternGuide
Choosing guarantees per featurelinearizable, causal, read-your-writes, eventualconsistency models
Concurrent updates to one recordconditional updates, optimistic versions, locksoptimistic vs pessimistic locking
No double booking or oversellingconstraints, holds with expirybookings and reservations
Retries causing duplicatesidempotency keysdistributed transactions and idempotency
Multi-service transactionssagas with compensationworkflow orchestration
Money movementdouble-entry ledger, reconciliationpayments and ledgers
One leader or lock holderleases with fencing tokens, consensusdistributed locks and leases
Agreement across replicasRaft or Paxoshow Raft works

Messaging and asynchrony

ProblemPatternGuide
Slow side effects in the request pathqueue them, respond earlysync vs async communication
Many consumers of the same eventsa partitioned log (Kafka)how Kafka works
Database change and event must both happentransactional outbox, CDCchange data capture
At-least-once deliveryidempotent consumers, dead-letter queuesdelivery semantics
Work at a future timedurable timers, partitioned schedulersdelayed jobs and distributed cron

Reliability

ProblemPatternGuide
Dependency failures cascadingtimeouts, retries with jitter, circuit breakersrate limiting and resilience
Traffic spikes beyond capacityload shedding, backpressure, waiting roomsload shedding and backpressure
Abuse and overusetoken bucket or sliding window limitsrate limiting algorithms
Losing a zone or regionactive-active services, standby databasesactive-active vs active-passive
Global usersmulti-region with home regionsmulti-region architecture
Data loss or corruptionbackups, point-in-time restore, tested recoverybackups and disaster recovery
Slow outliershedged requests, parallelism, deadlinestail latency

Real-time and collaboration

ProblemPatternGuide
Pushing updates to clientsWebSockets, SSE or pollingWebSockets vs SSE vs long polling
Millions of connections and presencegateways, session registry, TTL presencepresence and connection management
Reaching users when the app is closedpush notificationspush notifications
Concurrent editingCRDTs or operational transformationCRDTs vs operational transformation
Offline use and synclocal-first storage, change logs, conflict rulesoffline-first apps and sync

Search, ranking and geo

ProblemPatternGuide
Full-text searchinverted index, BM25how Elasticsearch works
Ordering results wellretrieve then rank, learning to ranksearch ranking and relevance
Search as you typetop-K per prefixtries and autocomplete
Nearby thingsgeohash, S2, H3 or quadtreesgeohash vs quadtree vs H3
Matching supply and demanddispatch with ETA and atomic claimsdispatch and marketplace matching
Personalised recommendationscandidate generation plus rankingrecommendation systems
Meaning-based retrievalembeddings and vector indexesvector search and RAG

Data processing

ProblemPatternGuide
Aggregating streams correctlyevent-time windows, watermarkswindowing and watermarks
Large batch computationsMapReduce or SparkMapReduce and Spark
Analytical storagecolumnar lakehouse tablesdata lakes and lakehouses
Approximate answers at scaleBloom filters, HyperLogLog, count-minprobabilistic data structures

Security and operations

ProblemPatternGuide
Login and sessionsshort tokens, refresh rotationJWT vs session cookies
Who can access whatRBAC plus relationship-based permissionsauthorization and permissions
Many customers on shared infrastructuretenant ids, quotas, cellsmulti-tenancy
Knowing the system is healthySLOs and burn-rate alertsSLIs, SLOs and error budgets
Debugging across servicesdistributed tracingdistributed tracing
Shipping safelycanaries, flags, progressive rolloutdeployment strategies

Putting it together

In an interview, identify the two or three problems that make the question hard, then reach for the matching patterns and explain their trade-offs. For example, Design a News Feed is mostly fan-out, caching and ranking; Design WhatsApp is connections, delivery guarantees and ordering; Design a Payment System is idempotency, ledgers and sagas; Design a URL Shortener is id generation, caching and edge delivery. Start with the interview framework for the overall structure.

Checklist

  • Name the hard problems in the question first.
  • Pick the matching pattern for each, with its trade-off.
  • Keep the rest of the design simple.
  • Read the linked guide for any pattern you cannot explain in two sentences.

Open in your browser to sign in

Google does not allow sign-in inside this app's built-in browser. Open this page in Safari and sign in there. The link opens this same page.

Tap the ⋯ or share button at the top or bottom of the screen, then Open in browser. Or copy the link and paste it into Safari.