Skip to Content

System Design Patterns

The 15 patterns that come up in 90% of system-design interviews, distilled from Alex Xu’s System Design Interview and Martin Kleppmann’s Designing Data-Intensive Applications.

Patterns at a Glance

#PatternUse when…Failure mode if misused
1CachingRead-heavy, latency-sensitiveStale cache, thundering herd
2ShardingData exceeds 1 serverHot shard, cross-shard joins
3ReplicationNeed availabilityReplication lag, stale reads
4Load BalancingMulti-instance backendSingle-bucket routing, no health checks
5Message QueuesBurst smoothing, decouplingPoison messages, dead-letter pile-up
6CAP TheoremChoosing a databaseWrong trade-off for the workload
7SagaMulti-service transactionCompensating logic bugs
8CQRSRead vs write scaling differEventual consistency bugs
9Rate LimitingPublic APIsBurst wrong, false positives
10Idempotency KeysNetwork retries on writesDouble-charge bugs
11Circuit BreakerUnstable downstream depsCascading failure
12Consistent HashingDynamic cache/DB clusterUneven load if vnodes too few
13Leader ElectionSingle-coordinator needSplit-brain
14Event SourcingAudit log / time travelEvent-versioning mishaps
15BulkheadMulti-tenant workloadsThread-pool starvation

How They Compose

A typical large system stacks many of these together. Example: a chat app

       client
         |
         v
   [ Load Balancer L7 ] -- health checks
         |
         v
   [ API fleet ] -- Bulkhead (tenant-isolated pools)
     |        |
     v        v
  [Cache]  [RateLimiter] -- token bucket
     |        |
     v        v
  [Service]  [Saga Orchestrator]
     |        |
     v        v
  [Replicated DB]  [Message Queue]  -->  downstream workers
                                      -->  [Event Store]

Every real system combines 5-10 of these. The interview is NOT “which one?”, it is “which ones, in what order, and what’s the trade-off?”.

Advertisement