Surviving the Spike
Surviving the Spike
A Production Engineer's Guide to Scalable Web Services.
This book targets senior developers and architects who have shipped web services and watched them fall over under load. You know what a REST endpoint is. You know what a cache is. You have a running distributed system. This book explains why it does not scale and how to fix it.
Every chapter uses the same domain: a ride-hailing platform modelled on Uber's architecture. Driver location ingestion, rider matching, fare calculation, trip history, and surge pricing. Code examples, diagrams, and failure scenarios all refer to this platform. Abstract scalability problems become concrete and consistent across the book.
Three opinions run through every chapter:
Redis is the definitive caching layer. Not Memcached, not Hazelcast, not Caffeine alone. Redis, used correctly, solves the majority of caching problems. Every caching chapter uses Redis. When a different tool is genuinely better for a specific sub-problem, the narrow case is stated explicitly, then the book returns to Redis as the default.
Reactive over blocking for I/O-bound services. Spring WebFlux with Project Reactor is the correct default for services that spend most of their time waiting. Spring MVC is not wrong, but when the bottleneck is I/O, blocking threads is waste.
Measure first, always. No optimization chapter proceeds without establishing a baseline with Locust. An opinion without a number is a preference. A number without a baseline is noise.
Code examples use Java 21, Spring Boot 3, and Spring WebFlux. Redis examples use Lettuce. Kubernetes manifests accompany every infrastructure component. Locust scripts measure every claim. Every chapter follows the same structure: the symptom, the cause, a Locust baseline that reproduces the problem, the fix, and the same Locust test re-run with the delta shown and explained.
This book was generated using AI assistance.