The Scaling Toolbox
coreadvancedThere are about ten ways to make a system handle more load, and they are not interchangeable. Some add capacity (scale out, scale up, autoscale). Some remove work (cache, CDN, batch). Some move work off the critical path (async processing, queues). Some remove contention (pooling, partitioning, workload isolation). The measurement tells you which category you need.
Think of it as
A queue at a counter can be fixed by opening more counters, serving each person faster, or having fewer people need to queue at all. Every scaling technique is one of those three, and picking the wrong one adds cost without shortening the queue.
What we're doing: Pick the right lever for an application that slows down under load.
- 1
- CPU at 25% already rules out the capacity category, which is where most scaling instincts start.
- 5
- Adding instances to a contention bottleneck makes it worse — this is the most expensive common mistake in this section.
- 9
- The fix costs less than the original state, because the wrong lever had been pulled repeatedly before anyone measured.
Why this works: The categories matter because pulling the wrong lever is not merely ineffective — for contention bottlenecks it actively harms. Knowing which of the three kinds you have is worth more than knowing all ten techniques.
Scaling out a service that shares a bounded downstream
Wrong
Better
What you see: Latency worsens after scaling out, and worsens further with each additional instance — the opposite of the expected relationship.
Why: Horizontal scaling assumes each instance brings its own capacity. When the constraint is a shared resource with a fixed limit — a connection pool, a licence, a rate-limited API — every new instance takes a smaller share of the same fixed amount, so throughput per instance falls faster than instance count rises.
- Add capacity
- Scale out — more instances; needs statelessness
- Scale up — bigger instance; usually a restart
- Autoscale — track a signal users feel
- Remove work
- Cache — worthless at a low hit rate
- CDN — serve static bytes at the edge
- Batch — amortize per-call overhead
- Remove contention
- Connection pooling — ration a bounded resource
- Partitioning — scales writes, changes the model
- Workload isolation — batch must not degrade interactive
Which lever for which bottleneck
Together
Remember: Three categories: add capacity (scale out/up, autoscale), remove work (cache, CDN, batch), remove contention (pooling, partitioning, isolation). Measure which one you have before choosing — scaling out a contention bottleneck makes it worse, not better.
See also: measure before scaling · performance vocabulary · cache aside write through and ttl

