scaling-evolution
This skill should be used when the user asks "how does this scale", "scale to millions", "scaling roadmap", "where is the bottleneck", "what breaks first", "10x growth", "vertical vs horizontal scaling", "scale from zero", or "what's the next scale curve". It gives the order-of-magnitude evolution path (single server → tiers → replicas → cache → CDN → stateless tier → multi-region → sharding) and a way to diagnose the *next* bottleneck instead of memorizing one big diagram. Use it whenever a design must grow by orders of magnitude or a load increase is on the table, even if the user doesn't say "scaling".
proyecto26 · 已有静态检查记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add proyecto26/system-design-skills --skill scaling-evolution技能说明
name: scaling-evolution description: This skill should be used when the user asks "how does this scale", "scale to millions", "scaling roadmap", "where is the bottleneck", "what breaks first", "10x growth", "vertical vs horizontal scaling", "scale from zero", or "what's the next scale curve". It gives the order-of-magnitude evolution path (single server → tiers → replicas → cache → CDN → stateless tier → multi-region → sharding) and a way to diagnose the next bottleneck instead of memorizing one big diagram. Use it whenever a design must grow by orders of magnitude or a load increase is on the table, even if the user doesn't say "scaling".
Scaling Evolution
Grow a design one bottleneck at a time. A system that serves 1k users and one that serves 10M users are different architectures, but you do not jump between them — you walk a path where each step removes the current ceiling and exposes the next. Getting this wrong means either over-building day one (paying multi- region complexity for 1k users) or freezing when load doubles because the design was a memorized end-state, not a sequence of justified moves (GUIDE #7).
When to reach for this
A load increase is on the table ("what if traffic 10×?", "scale to millions"), the user asks where the bottleneck is or what breaks first, or a single-box design has outgrown one machine. Reach here to sequence the next two or three moves — never the whole roadmap at once.
When NOT to
Do not pre-build steps the numbers do not yet demand (YAGNI). Sharding, multi-region, and a message queue are late moves; proposing them for a system that fits on two boxes is the over-indexing this skill defends against. If the current load fits comfortably on a vertically-scaled box with a replica, stop — that is the cheapest design that meets the constraint, and it wins. Naming the next five tiers when only one is needed is a red flag, not foresight.
Clarify first
The path is driven entirely by numbers and constraints, so pin these down before
moving (most come from requirements-scoping and back-of-the-envelope):
- Current and target scale — today's QPS/data and the multiple you must hit (2×? 100×?). The multiple decides how many steps you take now.
- Read:write ratio — read-heavy systems scale with replicas + cache; write- heavy systems hit the master/storage ceiling and need sharding far sooner.
- Where it hurts now — is the symptom compute (CPU saturated), storage (DB/disk saturated), or network (bandwidth/connections)? Diagnose before adding.
- Consistency and staleness budget — replicas and multi-region trade freshness
for scale; if reads must be current, that constrains the path (→
consistency-coordination). - State — is anything pinned to a server (sessions, local files)? Stateful tiers block horizontal scaling.
The method: walk the bottleneck ladder
Each rung removes one ceiling. Apply the next rung the numbers justify, not
the whole ladder. Full triggers and worked thresholds are in
references/scaling-ladder.md.
- Single server. Web, app, DB, cache on one box. Correct for low traffic and early validation. Breaks when one machine can't hold the load or the data.
- Split the tiers. Move the database (and later cache) onto its own host so web and data scale independently. Breaks when the single web box or single DB saturates, or either becomes a single point of failure.
- Vertical scale + replicate for reads. First scale up (bigger box — simple,
no app changes) until the hard limit or cost knee. Add read replicas to spread
reads off the primary (→
data-storageowns replication). Breaks when writes saturate the primary, or replica lag breaks freshness. - Add a cache. Put hot reads in front of the DB once a number shows reads
dominate (→
caching). Highest-leverage move for read-heavy systems. Breaks when writes are the bottleneck, or the working set no longer fits. - Push static/edge to a CDN. Offload images/JS/CSS/video to edge servers
close to users (→
content-delivery). Breaks when the bottleneck is dynamic requests, not static assets. - Make the web tier stateless + load-balance. Move session/state to a shared
store so any request hits any server; put a load balancer in front and
autoscale the fleet (→
load-balancing). This is the unlock for cheap horizontal scale. Breaks when the data tier (now the bottleneck) can't keep up. - Decouple with async. Move slow/bursty work (uploads, encoding, fan-out)
behind a queue so producers and consumers scale independently and spikes are
absorbed (→
messaging-streaming). Breaks when even the sync path or storage is the limit. - Multi-DC / multi-region. Geo-route users to the nearest healthy data center for latency and disaster survival; replicate across regions. Breaks when cross-region data sync, conflict resolution, or a single dataset too big for one region forces the last rung.
- Shard the data tier. Partition data across nodes when one primary can no
longer hold the writes/data (→
data-storageowns sharding/partitioning;consistency-coordinationowns consistent hashing). The most complex move — last, not first.
Vertical scaling (scale up: more CPU/RAM) is the cheap early move with no app changes but a hard ceiling and no redundancy. Horizontal scaling (scale out: more boxes) is the durable answer — better availability, near-unlimited headroom — but demands statelessness and adds coordination cost. Climb vertically until the knee, then go horizontal.
Diagnose the bottleneck before adding anything
"Add more servers" without a diagnosis is guessing (GUIDE #3, #7). Classify the pressure first, then act on that resource:
- Compute-bound (CPU/threads pegged, latency rises with request rate): add app servers / autoscale; check for an O(n) hot path before buying hardware.
- Storage-bound (