THIS EXPLANATION
THE ROOM
CDA·253 Computing, Data & AI 6 MIN · 8 STATIONS

Vertical and horizontal scaling

A Socratic walk-through of vertical and horizontal scaling — reasoned out one step at a time, not lectured.

abcdefgh
a

The question we started with

THE QUESTION #

Why does a point arrive where buying a bigger machine stops being an option at any price?

When a system is short of capacity there are two moves: make the machine bigger, or add more machines. The first is enormously easier — no code changes, no rethinking of where data lives, no new failure modes. You pay money and the problem goes away.

So why does every large system eventually stop doing the easy thing? Not because engineers prefer the hard one, but because at some point the easy one stops being available — and it stops before you run out of money. What makes a bigger machine cease to exist rather than merely cease to be affordable?

b

Reasoning it through

REASONING #

Begin with what "bigger" means: more cores, more memory, faster storage, more bandwidth. Is there a largest one? For a while, effectively no — you move from eight cores to sixteen to sixty-four and the parts exist. But parts come from a few manufacturers in a few designs, so at any moment there is a largest server you can buy. That number climbs over the years; today it sits in the low thousands of gigabytes of memory and the low hundreds of cores for a mainstream two-socket machine. Above that you are not shopping, you are commissioning.

That is the crude ceiling. Notice a second thing well below it: price does not rise in step with capacity. Doubling from small to medium costs roughly double; near the top each doubling costs several times the previous one, because the largest parts are made in small volumes and sell to buyers with no alternative. The ceiling is not a wall you hit at speed but a slope that steepens until climbing is absurd, so the practical limit arrives well below the physical one.

The third constraint is not about money at all. What does a bigger machine do for a workload not limited by the resource you added? Suppose the bottleneck is a single lock every request must acquire in turn: doubling the cores doubles the threads waiting for it and does nothing to the rate at which it is handed over. This is Amdahl's 1967 observation — speed-up from parallelism is bounded by the fraction of work that must happen serially. If a tenth is serial, no hardware gets you past a tenfold improvement; not expensive, impossible. Gunther's universal scalability law adds a coordination term, which is worse than a ceiling: past some point, adding workers makes throughput fall.

The fourth decides the matter in practice. A machine, however large, fails as a unit — its power supply, its rack, its data centre. The largest one you can buy has an availability set by one of everything, and no money converts one machine into two. Redundancy cannot be bought inside a box.

Put those together and the shape changes: vertical scaling does not end because big machines run out, but because three curves converge — cost turns superlinear, returns turn sublinear, and availability stays flat at one machine whatever you spend.

What does horizontal scaling do differently? It buys capacity at roughly linear cost — the hundredth machine costs what the first did — and redundancy as a side effect. It pays for both with the thing vertical scaling gave you free: a single address space where everything sees everything. Once state lives on more than one machine you have permanently acquired partitioning, replication, consensus, and network partitions. Those are not implementation details; they are the entire reason horizontal scaling is hard.

An honest caveat. For fifteen years the default advice was to go horizontal early, and much unnecessary distribution followed. Single machines have grown very large — a workload that genuinely required a cluster in 2010 often fits on one modern server — so "scale up until it hurts" is an increasingly respectable default. Vertical scaling is not primitive; it simply has a horizon, and it is worth knowing which of the four constraints reaches you first.

c

The analogy

THE ANALOGY #
THE FIGURE

Think of moving a load with a truck. For a long time the answer to a heavier load is a bigger truck. But trucks do not scale indefinitely: past a certain size the axles, the bridge weight limits, and the turning circle all bind, and a truck twice as large costs far more than twice as much. Eventually you send two trucks — cheap, and easy to keep adding to, except that now you must decide what goes in which, and a load that must arrive together no longer can.

WHERE IT BREAKS DOWN

two trucks can at least be told to arrive at the same time, whereas two machines cannot reliably agree on when anything happened — there is no shared clock, and not knowing whether the other machine is slow or dead has no equivalent on a road.

d

Clarifying the model

THE MODEL #

Three refinements.

First, the two are not alternatives chosen between once. Nearly every real system is both: horizontally scaled at the tier that splits easily (stateless request handling) and vertically scaled at the tier that does not (a primary database). The interesting engineering is about which components sit on which side of that line.

Second, "stateless" is what makes horizontal scaling cheap, and it does not mean the system holds no state — it means each machine holds none another would need. That is why scaling web servers is a purchase and scaling databases is a project. The state did not disappear; it moved somewhere that is still, usually, one machine.

Third, a caution about Amdahl's law. It is often quoted as if it forbade large-scale parallelism, which it does not: Gustafson pointed out in 1988 that people use bigger machines to solve bigger problems, and a larger problem's serial fraction is frequently smaller. Both laws are correct and answer different questions — Amdahl asks how much faster a fixed problem gets, Gustafson how much more problem fits in fixed time. Which applies depends on whether your workload grows with your hardware, and for most systems serving more users, it does.

e

A picture of it

THE PICTURE #
Vertical and horizontal scaling
Vertical and horizontal scaling The horizontal axis is the nominal size of one machine, doubling each step. The bars are what it costs; the line is what you actually get. Early on the two track each other, which is why scaling up is the right first move. Then they separate in both directions at once -- the bars turn superlinear as the largest parts grow scarce, the line flattens as the serial fraction begins to bind -- and the widening gap is the whole argument. Treat the numbers as the shape of the relationship, not measured values: the curvature is real, the specific ratios depend on workload and hardware generation. {"generator":"mermaid-svg-renderer@3.2.1","source":"../Socrates/.diagram-cache/_src/vertical-and-horizontal-scaling.md","sourceIndex":1,"sourceLine":4,"sourceHash":"5368a26162c981a707836be158c466ca1a2f192c8a15dfa62721695c4e47da7c","diagramType":"xychart","layoutVariant":"source","repairedDuplicateIds":[],"motion":"entrance-with-reduced-motion-fallback","presentation":"editorial","attempt":1,"viewBox":{"x":0,"y":0,"width":790,"height":636},"qa":{"passed":true,"findings":[]}} 1 unit 2 units 4 units 8 units 16 units 32 units 60 55 50 45 40 35 30 25 20 15 10 5 0 Relative to the smallest machine

How to readThe horizontal axis is the nominal size of one machine, doubling each step. The bars are what it costs; the line is what you actually get. Early on the two track each other, which is why scaling up is the right first move. Then they separate in both directions at once — the bars turn superlinear as the largest parts grow scarce, the line flattens as the serial fraction begins to bind — and the widening gap is the whole argument. Treat the numbers as the shape of the relationship, not measured values: the curvature is real, the specific ratios depend on workload and hardware generation.

f

What became clearer

WHAT CLEARED #
WHAT CLEARED

Buying a bigger machine stops working for four independent reasons, and only one is money. Parts have a largest size; price per unit of capacity turns superlinear near the top; returns turn sublinear once serialisation and coordination dominate; and a machine cannot be made redundant with itself at any price. Horizontal scaling answers all four and charges in the one currency vertical scaling never asked for: a single shared view of the state. That trade, not the hardware, makes the transition a redesign rather than a purchase.

g

Where to go next

ONWARD #
  • How sharding splits state across machines, and which queries stop being answerable once it has.
  • The universal scalability law's second term: the point at which adding a machine reduces total throughput.
h

Key terms

TERMS #
TermWhat it means
Vertical scalingincreasing the capacity of a single machine (scaling up).
Horizontal scalingadding machines and dividing work between them (scaling out).
Amdahl's lawthe 1967 observation that speed-up from parallelism is capped by the fraction of work that must be performed serially.
Gustafson's lawthe 1988 counterpoint that larger machines are used for larger problems, whose serial fraction is often smaller.
Universal scalability lawNeil Gunther's extension adding a coordination cost, which can make throughput fall as workers are added.
Stateless tiera layer whose machines hold no data another would need, which is what makes it cheap to replicate.

Every term the collection defines is gathered in the glossary.

Nearby on the shelf

4