Principle
Scaling is what happens when success stresses the system you built for learning — traffic, data, support load, team size, compliance questions. AI lets you patch faster; it does not remove the need to measure pain before splitting services or hiring.
Scale problems are real when they are measured: p95 latency, queue depth, on-call pages, cost per user, support tickets per release. Until then, premature scale is vanity architecture.
The decision
DEC_017
Vertical scale (bigger box, index, cache)
│
▼ still hurting?
Horizontal scale (workers, read replicas)
│
▼ still hurting?
Split boundaries (services, queues) — with ADR
│
▼
Team + process (on-call, SLOs)What scales first (usually)
- Database — indexes, query shape, connection pooling.
- Caching — read-heavy paths; invalidate with a story.
- Background jobs — email, webhooks, heavy work off request path.
- CDN / edge — static assets, edge functions for latency.
- People — support, then engineering — when signal says you cannot automate the pain away.
AI at scale
- Agents for internal ops — runbooks, log triage, draft postmortems — not unsupervised customer-facing automation at volume.
- Rate limits and cost caps on model calls — growth meets token bills fast.
- Evals if AI is in the product path — quality drifts under load.
Workflow
- Identify bottleneck with data — not gut.
- Write ADR if the fix changes architecture (Chapter 11).
- Implement smallest relief — often not microservices.
- Load test or replay production traffic sample.
- Set SLO — one availability or latency target users feel.
- Revisit monthly — remove scale complexity that no longer pays rent.
Common mistakes
- Microservices before monolith catches fire.
- Scaling headcount before workflow is repeatable.
- Ignoring support as scaling signal — humans are the queue.
- AI features without cost model at 10× traffic.
Artifacts
- Capacity note — current limits, next threshold, owner.
- Incident/postmortem template when scale bites — blameless, action items.
Further reading
- Chapter 11 — Architecture decisions
- Chapter 13 — Deployment
- Chapter 17 — Teams and governance