Scale Lab
10 missions and 23 lessons written. A naive Java ordering service, one defect a day: measure it, fix it, prove it.
- 01Open your eyes: a dashboard tourRED, p50/p95/p99, why the average liesready
- 0209:00 rush: the breaking pointLittle's Law, connection pool, saturationready
- 03The dealer's order historyEXPLAIN, seq scan, index, Flyway migrationready
- 04One request, many queriesN+1, Hibernate lazy loading, batch fetchingready
- 05Slow payments slow down everythingtransaction boundary, pool exhaustionready
- 06The last 10 itemsrace condition, lost update, atomic UPDATE, optimistic lockready
- 07The provider stops answeringtimeouts (connect/read), fail fastready
- 08Retry, but wiselyretry, exponential backoff, jitter (Resilience4j)ready
- 09Open the circuitcircuit breaker, bulkhead, fallbackready
- 10The same order twiceidempotency key, unique constraintready
- 11Price list cacheRedis, cache-aside, TTLlesson only
- 12Cache expired, everyone rushed the DBthundering herd, request coalescinglesson only
- 13One dealer slows down everyonerate limiting, token bucket, noisy neighborlesson only
- 143 instances + a load balancerstateless service, horizontal scaling, nginxlesson only
- 15Virtual threadsJava 21+ Loom, thread-per-request, pinninglesson only
- 16Don't lose the order eventdual write, outbox pattern, Kafkalesson only
- 17The consumer crashedat-least-once, consumer idempotency, DLQlesson only
- 18SLOs and alertsSLI/SLO, error budget, burn rate alertlesson only
- 19Why is it slow: flame graphsprofiling (Pyroscope), allocation, GClesson only
- 20Reads go to a replicaread replica, replication lag, read-your-writeslesson only
- 21400k → 40M orderspartitioning, archiving, vacuumlesson only
- 22Chaos daykilling instances, DB restart, graceful shutdownlesson only
- 23Capacity reportcapacity planning, bottleneck chainlesson only