Scalability planning
Scalability is designed against a number, not a feeling. Start from a
load model, find where it breaks, and design for the next order of
magnitude: not ten, because that is today, and not a thousand, because
that is architecture astronomy you will rebuild before you reach it.
Method
- Build the load model first. Requests per second at
peak, data volume and growth rate, read/write ratio,
payload sizes, and the concurrency shape (steady vs
spiky): tied to the business driver (see
capacity-planning, product-metrics). Every scaling
decision references this model; designing for scale
without a number is guessing which is why systems get
over- and under-built at once.
- Find the bottleneck by math, then by test. Trace the
load through the system and compute where it saturates
first (usually the database, a shared lock, or a
single-threaded stage: see systems-profiling,
concurrency-tuning); intuition picks the wrong component
routinely. Confirm with load testing (see load-testing)
and design the fix for the real bottleneck, not the
scary-looking one.
- Scale horizontally by removing shared state. Stateless
services scale by adding instances (see
autoscaling-policies); the hard part is the stateful tier.
Push state to the data layer, make services share nothing,
and design the data layer to scale (read replicas for
read-heavy, sharding/partitioning for write-heavy: see
sharding-partitioning, materialized-views,
caching-strategy). The stateless tier is easy; the plan is
really a data-scaling plan.
- Design for the next 10x, not the current 1x or a
fantasy 1000x. Architect so the known next order of
magnitude does not require a rewrite, and no further:
over-engineering for scale you may never reach costs
real complexity now (see premature-abstraction,
monolith-first) and often makes the current system worse.
Re-plan at each order of magnitude; the right design at
1M users differs from the one at 1K.
- Prefer asynchrony and caching to absorb load. Queue
spiky work so the system processes at its own pace
(see message-queues, backpressure); cache expensive
reads with a considered invalidation strategy (see
caching-strategy, cache-invalidation); precompute where
read latency matters (see cqrs, materialized-views).
These absorb load without linearly scaling the
expensive components.
- Degrade gracefully past the plan. Load will
eventually exceed any design; the system sheds load,
serves stale, or reduces functionality rather than
collapsing (see backpressure, partition-tolerance's
degraded modes). A scalability plan includes what
happens when you exceed it, because you will.
Boundaries
- Premature scaling is a top way startups waste effort:
most systems never reach the scale their architecture
was over-built for, and the complexity slows them
reaching it (see monolith-first, mvp-scoping). Build
for realistic near-term growth.
- Scalability (handling more load) is distinct from
performance (handling one request fast: see
performance-optimization) and availability (staying up:
see multi-region-design); a plan conflating them
optimizes the wrong axis.
- Vertical scaling (a bigger machine) is the boringly
correct first answer for many systems and buys years
cheaply; exhaust it before distributed complexity (see
managed-vs-selfhosted's honesty).
1---2name: scalability-planning3description: Plan scalability from a load model and bottleneck math, designing for realistic growth without premature over-engineering. Use when designing for scale or after a load-driven incident.4---56# Scalability planning78Scalability is designed against a number, not a feeling. Start from a9load model, find where it breaks, and design for the next order of10magnitude: not ten, because that is today, and not a thousand, because11that is architecture astronomy you will rebuild before you reach it.1213## Method14151. **Build the load model first.** Requests per second at16 peak, data volume and growth rate, read/write ratio,17 payload sizes, and the concurrency shape (steady vs18 spiky): tied to the business driver (see19 capacity-planning, product-metrics). Every scaling20 decision references this model; designing for scale21 without a number is guessing which is why systems get22 over- and under-built at once.232. **Find the bottleneck by math, then by test.** Trace the24 load through the system and compute where it saturates25 first (usually the database, a shared lock, or a26 single-threaded stage: see systems-profiling,27 concurrency-tuning); intuition picks the wrong component28 routinely. Confirm with load testing (see load-testing)29 and design the fix for the *real* bottleneck, not the30 scary-looking one.313. **Scale horizontally by removing shared state.** Stateless32 services scale by adding instances (see33 autoscaling-policies); the hard part is the stateful tier.34 Push state to the data layer, make services share nothing,35 and design the data layer to scale (read replicas for36 read-heavy, sharding/partitioning for write-heavy: see37 sharding-partitioning, materialized-views,38 caching-strategy). The stateless tier is easy; the plan is39 really a data-scaling plan.404. **Design for the next 10x, not the current 1x or a41 fantasy 1000x.** Architect so the known next order of42 magnitude does not require a rewrite, and no further:43 over-engineering for scale you may never reach costs44 real complexity now (see premature-abstraction,45 monolith-first) and often makes the current system worse.46 Re-plan at each order of magnitude; the right design at47 1M users differs from the one at 1K.485. **Prefer asynchrony and caching to absorb load.** Queue49 spiky work so the system processes at its own pace50 (see message-queues, backpressure); cache expensive51 reads with a considered invalidation strategy (see52 caching-strategy, cache-invalidation); precompute where53 read latency matters (see cqrs, materialized-views).54 These absorb load without linearly scaling the55 expensive components.566. **Degrade gracefully past the plan.** Load will57 eventually exceed any design; the system sheds load,58 serves stale, or reduces functionality rather than59 collapsing (see backpressure, partition-tolerance's60 degraded modes). A scalability plan includes what61 happens when you exceed it, because you will.6263## Boundaries6465- Premature scaling is a top way startups waste effort:66 most systems never reach the scale their architecture67 was over-built for, and the complexity slows them68 reaching it (see monolith-first, mvp-scoping). Build69 for realistic near-term growth.70- Scalability (handling more load) is distinct from71 performance (handling one request fast: see72 performance-optimization) and availability (staying up:73 see multi-region-design); a plan conflating them74 optimizes the wrong axis.75- Vertical scaling (a bigger machine) is the boringly76 correct first answer for many systems and buys years77 cheaply; exhaust it before distributed complexity (see78 managed-vs-selfhosted's honesty).