Start here · Chapter 1, One machine
Overloaded database
Users send 2,000 requests/s.
01 / 41BuildDifficulty
- Core path
- 0/41
- Stars
- 0/123
- Depth worlds
- 0/265
Core path
Chapter 1: One machineFind the bottleneck, read the latency ladder and size a box.
- 01 Overloaded databaseBuildNext
- 02 The latency ladderOrderLocked
- 03 Fifty dependent readsEstimateLocked
- 04 Two boxesBuildLocked
- 05 How many boxes?EstimateLocked
- 06 Safe load limitTuneLocked
- 07 Black FridayBossSurviveLocked
OpensSignal0/10First server, capacity and costMetal0/12One node, a VPS, racks and the datacenter
One server boardDrag or use arrow keys to change the load 280 req/s · CPU 70% · mean 22 ms
Chapter 2: CachingHit ratio, stale reads, stampedes and the edge.
- 08 Hit ratioTuneLocked
- 09 TTL and stale readsTuneLocked
- 10 StampedeFixLocked
- 11 Images at the edgeBuildLocked
- 12 Flash crowdBossSurviveLocked
OpensCacheCaches, CDNs and the edge
Chapter 3: Many machinesScale out behind a load balancer and keep state out of the process.
- 13 One big or three smallChooseLocked
- 14 Behind the balancerBuildLocked
- 15 StatelessBuildLocked
- 16 URL shortenerBossBuildLocked
OpensScaleLoad balancing, sharding and partitioningWireNetworking and protocols
Chapter 4: QueuesAsync work, requests in flight, backpressure and duplicates.
- 17 Queue the emailBuildLocked
- 18 Requests in flightEstimateLocked
- 19 BackpressureBuildLocked
- 20 Duplicate deliveryFixLocked
- 21 Event stormBossSurviveLocked
OpensQueueAsync work, messaging and streamsFlowBatch, streams and analyticsLockSecurity and identityChainPayments and ledgers
Chapter 5: FailureTimeouts, retries, nines and failure domains.
- 22 No timeoutTuneLocked
- 23 Retry stormFixLocked
- 24 Count the ninesEstimateLocked
- 25 Spread across racksBuildLocked
- 26 Multi-cause incidentBossFixLocked
OpensGuardTimeouts, retries, breakers and recoveryWatchObservability, deploys and operations
Chapter 6: CopiesReplicas, lag, quorums and network cuts.
- 27 Read replicasBuildLocked
- 28 Where is my postFixLocked
- 29 Sync or async copyBuildLocked
- 30 Cut the networkBuildLocked
- 31 Quorum sizesTuneLocked
- 32 Partition stormBossSurviveLocked
OpensStoreStorage engines and databasesQuorumReplication, consistency and consensus
Chapter 7: PartitionsShard keys, hot keys, adding nodes and tail latency.
- 33 The shard keyChooseLocked
- 34 Add a nodeBuildLocked
- 35 Tail at scaleEstimateLocked
- 36 Fit the modelChooseLocked
- 37 Likes at scaleBossBuildLocked
OpensFabricGPU setupsModelMachine learning systemsAgentLLM and agent systems
Chapter 8: Planet scaleLight in glass, paths through space, three continents.
- 38 Glass or microwaveEstimateLocked
- 39 Rank long pathsOrderLocked
- 40 Where space winsTuneLocked
- 41 Three continentsBossBuildLocked
OpensLightLight in glass, air and vacuumPixelFrontend and mobile systems
End of the core path. Every world opens.
Depth worlds
0/265Each depth world goes deeper into one topic. A chapter of the core path opens it.
Chapter 1 · One machine
MetalOne node, a VPS, racks and the datacenter
- 02 Inside one boxOrder
- 03 Scan or random readsEstimate
- 04 Working set per coreTune
- 05 Pad the hot cache lineFix
- 06 Find the slowest stageBuild
- 07 Group commit windowTune
- 08 Kernel stack, bypass or RDMAChoose
- 09 Store-and-forward wire timeEstimate
- 10 Read the spec sheetChoose
- 12 Uplink oversubscriptionEstimate
- 13 Pace the fan-inFix
- 14 Datacenter failure wavesSurvive
Chapter 2 · CachingLocked
CacheCaches, CDNs and the edge
- 05 Write-through or write-backChooseLocked
- 06 InvalidateBuildLocked
- 08 Origin shieldTuneLocked
- 09 The cache keyFixLocked
- 10 LRU or LFUChooseLocked
- 11 The hot keyFixLocked
- 13 Missing keysFixLocked
- 15 Personal but cachedBuildLocked
- 16 Serve staleTuneLocked
- 17 Where do sessions liveChooseLocked
- 19 Remove a useless cacheFixLocked
- Cache · LockedCaches, CDNs and the edge
Chapter 3 · Many machinesLocked
ScaleLoad balancing, sharding and partitioning
- 02 Uneven workChooseLocked
- 04 Health checksTuneLocked
- 05 Sticky troubleFixLocked
- 06 Boot timeTuneLocked
- 07 50k readsBuildLocked
- 09 Range or hashChooseLocked
- 14 Scatter-gatherFixLocked
- 16 Hedged requestsTuneLocked
- 18 Multi-region writesChooseLocked
- 19 Cell architectureBuildLocked
- 20 BulkheadsBuildLocked
- 21 Split the monolith?ChooseLocked
- 22 Sortable ids without a counterBuildLocked
- 23 Unique handles across regionsBuildLocked
- 24 Ten times the trafficSurviveLocked
- Scale · LockedLoad balancing, sharding and partitioning
WireNetworking and protocols
- 01 After you press EnterOrderLocked
- 02 Connection reuseChooseLocked
- 04 HTTP/2 multiplexingFixLocked
- 05 HTTP/3 on a lossy linkChooseLocked
- 06 TLS 1.3 handshakeOrderLocked
- 07 Zero round tripsChooseLocked
- 08 Time to liveTuneLocked
- 09 Closest regionBuildLocked
- 10 One address, everywhereChooseLocked
- 11 REST or gRPCChooseLocked
- 12 Compression levelTuneLocked
- 13 Polling stormFixLocked
- 14 One-way newsChooseLocked
- 15 A million socketsEstimateLocked
- 16 Live scoresBuildLocked
- 17 Webhooks that landBuildLocked
- 18 The long fat pipeEstimateLocked
- 20 L4 or L7ChooseLocked
- 21 Loss across the oceanFixLocked
- 22 N+1 at the gatewayFixLocked
- 26 200k devicesBuildLocked
- Wire · LockedNetworking and protocols
Chapter 4 · QueuesLocked
QueueAsync work, messaging and streams
- 02 Drain the backlogTuneLocked
- 03 Poison messageFixLocked
- 05 In orderChooseLocked
- 07 Lagging consumerFixLocked
- 08 One event, four servicesBuildLocked
- 09 Log or queueChooseLocked
- 10 Log retentionTuneLocked
- 12 Remind me laterBuildLocked
- 13 The sagaBuildLocked
- 14 The outboxBuildLocked
- 16 Visibility timeoutTuneLocked
- 17 Priority with fairnessBuildLocked
- Queue · LockedAsync work, messaging and streams
FlowBatch, streams and analytics
- 01 ETL or ELTChooseLocked
- 02 Split the nightly batchBuildLocked
- 03 Watermark delayTuneLocked
- 04 Pick the window typeChooseLocked
- 05 Deduplicate click countsBuildLocked
- 06 Query the lakeBuildLocked
- 07 Rows or columnsChooseLocked
- 08 Partition pruningFixLocked
- 09 Compact small filesFixLocked
- 10 Throttle the backfillBuildLocked
- 11 New fieldFixLocked
- 12 Trending tags with a sketchBuildLocked
- 13 Unique visitorsEstimateLocked
- 14 Bad batchBuildLocked
- 15 Stream into the analytics storeBuildLocked
- 16 Year-end data capacitySurviveLocked
- Flow · LockedBatch, streams and analytics
LockSecurity and identity
- 02 Stolen tokenFixLocked
- 03 OAuth code flow with PKCEOrderLocked
- 04 No more phishingChooseLocked
- 05 Password hash settingsChooseLocked
- 06 Limit code guessesBuildLocked
- 07 Request flood wavesSurviveLocked
- 08 Bots at the doorBuildLocked
- 09 Rotate a leaked keyFixLocked
- 10 Encrypt with data keysBuildLocked
- 11 Mutual TLS between servicesBuildLocked
- 12 Scope database rightsFixLocked
- 13 Tenant data layoutChooseLocked
- 15 Private downloadsBuildLocked
- 16 Fetch anythingFixLocked
- 17 Tamper-evident audit logBuildLocked
- 18 End-to-end key setupOrderLocked
- 19 Dependency supply chainChooseLocked
- 20 Contain a breachFixLocked
- Lock · LockedSecurity and identity
ChainPayments and ledgers
- 01 Double entryBuildLocked
- 03 Card payment statesOrderLocked
- 04 ReconcileBuildLocked
- 05 Deposit confirmationsEstimateLocked
- 06 Fee marketTuneLocked
- 07 ReorgFixLocked
- 08 Coins or accountsChooseLocked
- 09 RPC at scaleBuildLocked
- 10 IndexerBuildLocked
- 11 Hot and coldBuildLocked
- 12 Who signsChooseLocked
- 13 Stuck noncesFixLocked
- 15 RollupsChooseLocked
- 17 Price feedBuildLocked
- 18 Match engineBuildLocked
- 20 Market spikeSurviveLocked
- Chain · LockedPayments and ledgers
Chapter 5 · FailureLocked
GuardTimeouts, retries, breakers and recovery
- 02 Retry budgetTuneLocked
- 04 Circuit breakerBuildLocked
- 05 Token bucket per API keyBuildLocked
- 06 Shed low-priority loadBuildLocked
- 07 Last good list as fallbackBuildLocked
- 08 Single points of failureFixLocked
- 09 Spread across zonesBuildLocked
- 10 Warm standby regionBuildLocked
- 11 Active-active or standbyChooseLocked
- 12 Deep health checksFixLocked
- 13 Bulkhead against a cascadeFixLocked
- 14 Canary with automatic rollbackFixLocked
- 15 Blue and greenOrderLocked
- 16 Kill switch deliveryChooseLocked
- 19 Chaos day: four failure drillsSurviveLocked
- Guard · LockedTimeouts, retries, breakers and recovery
WatchObservability, deploys and operations
- 01 Missing metricsFixLocked
- 02 RED for the service, USE for the diskChooseLocked
- 03 Metric cardinalityFixLocked
- 04 Log samplingTuneLocked
- 05 Find the slow spanBuildLocked
- 06 Alert fatigueChooseLocked
- 10 Global config pushFixLocked
- 11 Next six monthsEstimateLocked
- 12 Before the usersBuildLocked
- 14 Checksums and reconciliationFixLocked
- Watch · LockedObservability, deploys and operations
Chapter 6 · CopiesLocked
StoreStorage engines and databases
- 01 Pick the storeChooseLocked
- 02 The missing indexFixLocked
- 03 Unused indexesTuneLocked
- 04 B-tree or LSMChooseLocked
- 05 Compaction debtFixLocked
- 09 One hot rowFixLocked
- 11 Page 5,000FixLocked
- 12 Rename a column liveOrderLocked
- 13 DenormalizeChooseLocked
- 14 Any attributeBuildLocked
- 15 Points per secondBuildLocked
- 16 Find the postBuildLocked
- 17 Near meBuildLocked
- 18 Blob or rowChooseLocked
- 19 Cold storageEstimateLocked
- 20 Backups that countBuildLocked
- 22 Forget meFixLocked
- 23 The ledger logBuildLocked
- 24 Follow the changesBuildLocked
- 26 Wide rowsBuildLocked
- Store · LockedStorage engines and databases
QuorumReplication, consistency and consensus
- 02 Promoted too soonFixLocked
- 03 Two leadersFixLocked
- 05 Election timeoutTuneLocked
- 06 Raft electionOrderLocked
- 10 Cart or balanceChooseLocked
- 11 Is it linearizableChooseLocked
- 13 Reads go back in timeFixLocked
- 14 Skewed clocksFixLocked
- 15 Lamport timeOrderLocked
- 16 Lost updateFixLocked
- 17 Write skewFixLocked
- 18 Double bookingFixLocked
- 19 Isolation levelsChooseLocked
- 20 Two-phase commitOrderLocked
- 22 The lock with a tokenBuildLocked
- 24 A counter with no coordinationBuildLocked
- 25 Locks, OT or CRDTChooseLocked
- 26 Lease timeoutTuneLocked
- Quorum · LockedReplication, consistency and consensus
Chapter 7 · PartitionsLocked
FabricGPU setups
- 01 Weights plus KV cacheEstimateLocked
- 02 Decode reads every weightEstimateLocked
- 04 Ring all-reduce timeEstimateLocked
- 05 Micro-batches fill the pipelineTuneLocked
- 06 Tensor parallel inside the serverBuildLocked
- 07 Drain the stragglerFixLocked
- 08 Rail-aligned leaf switchesBuildLocked
- 09 Stream the checkpointsFixLocked
- 10 A week of trainingSurviveLocked
- Fabric · LockedGPU setups
ModelMachine learning systems
- 01 Nightly scores or live rankingChooseLocked
- 02 Online feature storeBuildLocked
- 03 One path for training and servingFixLocked
- 04 From the futureFixLocked
- 05 DriftFixLocked
- 06 The thresholdTuneLocked
- 07 Shadow traffic to a new modelBuildLocked
- 08 How long to testEstimateLocked
- 09 Canary modelOrderLocked
- 10 CPU or GPU for boosted treesChooseLocked
- 11 Batch size inside 50 msTuneLocked
- 12 Retrieve then rankBuildLocked
- 13 Recall vs speedTuneLocked
- 14 Batch embedding on GPUsBuildLocked
- 15 Cold start for new itemsChooseLocked
- 16 Feedback loopFixLocked
- 17 Late labelsChooseLocked
- 18 Feature refresh intervalTuneLocked
- 20 Shifting fraud attacksSurviveLocked
- Model · LockedMachine learning systems
AgentLLM and agent systems
- 01 Tokens cost moneyEstimateLocked
- 03 Batch size on one GPUTuneLocked
- 04 KV memoryEstimateLocked
- 05 Serve one model on two GPUsBuildLocked
- 06 Cache the shared prompt prefixTuneLocked
- 07 Send each request type to its own modelBuildLocked
- 08 Model provider failoverFixLocked
- 09 Bounded queue under a token limitBuildLocked
- 10 Embed on write, retrieve on readBuildLocked
- 12 Hybrid searchBuildLocked
- 13 Semantic cache and entry lifetimeTuneLocked
- 14 Protect each tool by its failure modeBuildLocked
- 15 Agent loop limitsFixLocked
- 16 Resume agent tasks after a crashBuildLocked
- 17 Idempotency key for a tool callFixLocked
- 18 Warm sandboxes for generated codeBuildLocked
- 19 Separate page reading from toolsFixLocked
- 20 Separate queue for human approvalsBuildLocked
- 21 Run evals off the serving pathBuildLocked
- 22 One agent, a planner, or a teamChooseLocked
- 23 What to store as agent memoryChooseLocked
- 24 Protect a fixed GPU fleet at launchSurviveLocked
- Agent · LockedLLM and agent systems
Chapter 8 · Planet scaleLocked
LightLight in glass, air and vacuum
- 03 Fiber route factorChooseLocked
- 04 The latency floorEstimateLocked
- 05 Microwave or fiberChooseLocked
- 06 Up and down legsEstimateLocked
- 08 Laser path across the AtlanticBuildLocked
- 09 Hollow-core fiberChooseLocked
- 10 Leader next to its majorityBuildLocked
- 11 Subsea cable cutSurviveLocked
- 12 Lunar relay outboxBuildLocked
- Light · LockedLight in glass, air and vacuum
PixelFrontend and mobile systems
- 01 Where the page is renderedChooseLocked
- 02 JavaScript budgetTuneLocked
- 03 Heavy imagesBuildLocked
- 04 Request waterfall on loadFixLocked
- 05 Backend for frontendBuildLocked
- 06 Offline edits and mergeBuildLocked
- 07 Endless feedBuildLocked
- 10 Optimistic update or waitChooseLocked
- 12 Old app versionsFixLocked
- 13 Push campaign under provider limitsBuildLocked
- 14 Reliable chat sendBuildLocked
- 16 10k ticksBuildLocked
- Pixel · LockedFrontend and mobile systems