Horizontal vs. Vertical Scaling (Scale-Out Is a Coordination Problem, Not a Capacity Problem) | PulseSoft
Skip to content

Horizontal vs. Vertical Scaling (Scale-Out Is a Coordination Problem, Not a Capacity Problem)

PulseSoft Team · · 12 min read

Consider a relational database primary running at 85% CPU. The team doubles its cores and memory, expecting roughly twice the headroom. Throughput improves by a fraction of that, and p99 latency barely moves. Then they add four read replicas, and write latency does not change at all.

Neither result is a mystery once you stop thinking of scaling as "adding capacity." Every system contains work that can run in parallel and work that must be serialized or coordinated: a write-ahead log, a row lock, a single leader, a shared counter. Adding resources only accelerates the parallel part.

That is the real question behind horizontal vs vertical scaling. Scaling up (a bigger machine) keeps coordination inside one box, where it is cheap but bounded by hardware. Scaling out (more machines) removes the hardware ceiling but moves coordination onto the network, where it is slower, can fail partially, and must be designed explicitly.

This article treats the scale-up vs scale-out decision as an architectural one. It covers how to reason about it for stateless compute, databases, caches, and storage, and how to tell which constraint you are actually hitting.

The First-Principles Model: Serialized Work and Coordination Cost

Two models make this concrete.

Amdahl's Law says that if a fraction s of the work is serialized, the maximum speedup from N units of parallelism is 1 / (s + (1 - s) / N). If 5% of request processing is serialized, no amount of hardware delivers more than a 20x speedup.

The Universal Scalability Law (Neil Gunther) adds a second term. Beyond contention for a shared resource (α), there is a coherency cost (β): the work nodes must do to agree with each other. Relative capacity becomes:

C(N) = N / (1 + α(N - 1) + βN(N - 1))

The quadratic β term is the important part. When every node must exchange information with every other node, adding nodes eventually reduces throughput. This is retrograde scaling, and it is why some clusters get slower as they grow.

// Peak useful node count under the Universal Scalability Law.
// alpha: contention (serialized fraction); beta: coherency (pairwise coordination).
func PeakNodes(alpha, beta float64) float64 {
	if beta == 0 {
		return math.Inf(1) // no coherency cost: throughput approaches 1/alpha asymptotically
	}
	return math.Sqrt((1 - alpha) / beta)
}

With α = 0.03 and β = 0.0005, throughput peaks around 44 nodes. Past that, every node added makes the system slower. The values are illustrative, but the shape is not: coordination cost, not hardware, sets the ceiling.

Both scaling strategies pay these costs. A large server pays coordination through cache coherence traffic, memory bus contention, and lock contention between cores, all measured in nanoseconds. A cluster pays it through network round trips, measured in hundreds of microseconds to milliseconds within a region. Scaling out multiplies the price of every coordination step by several orders of magnitude, which is why distributed designs work hard to avoid coordination altogether.

What happens when a stateful dependency nears saturation

Consider a checkout service: an API tier calls a database to reserve inventory and publishes an event to a message broker. The database is approaching saturation, not failing.

Queueing behavior is nonlinear. In a simple M/M/1 model, mean time in system is 1 / (μ - λ). At 50% utilization, a request spends twice its service time in the system; at 90%, ten times. The database does not fail at 100%. It degrades well before it, and the causal chain looks like this:

DB utilization rises
  → per-query latency rises nonlinearly
  → API connection pool slots are held longer
  → pool exhausts; requests queue in the API tier
  → API latency exceeds client timeouts
  → clients retry, adding load the DB never needed
  → DB utilization rises further

Now apply the reflexive fix: autoscale the API tier. Each new API instance opens its own connection pool. The stateless tier scaled out cleanly, and in doing so it increased concurrency against the one component that could not. Horizontal scaling of the wrong layer amplified the bottleneck.

The general lesson: a system is only as scalable as its least scalable stateful component, and scaling the layers in front of it shifts pressure rather than relieving it.

Distributed Systems Scalability, Layer by Layer

The scale-up vs scale-out tradeoff plays out differently depending on where state lives.

Stateless compute: where scaling out is genuinely cheap

Mental model: horizontal scaling is cheap exactly where there is no shared state to coordinate. A stateless API instance can be added or removed without any other instance knowing.

Why it works: each request carries or fetches everything it needs, so a load balancer can route it anywhere. Failure of one instance loses only in-flight requests, which clients can retry if the operations are idempotent.

What it introduces: "stateless" usually means the state was moved, not removed. Sessions go to a cache, files to object storage, coordination to the database. Scale-out also brings cold starts, uneven load from long-lived connections (load balancers distribute connections, not necessarily requests), and the connection fan-in problem described above.

Tradeoff: compute scale-out converts a capacity problem into a downstream concurrency problem. That is usually a good trade, provided the downstream components are protected by pool limits, admission control, or a queue.

Databases: vertical first, because coordination is the product

A database exists to provide coordination: transactions, uniqueness constraints, consistent reads. That is why database scaling strategies usually start vertical. A single primary can enforce invariants like "no two orders consume the same inventory unit" using local locks and a local log, at memory speed.

Vertical scaling has real limits, though, and they are not only the size of the largest available instance:

  • Serialized write paths. WAL flushes, hot row locks, and index page latches do not get faster with more cores.
  • Recovery time grows with size. A larger buffer pool takes longer to warm after failover; a larger dataset takes longer to restore or rebuild a replica from.
  • Cost curves steepen. Pricing varies by provider and changes over time, but the top tier of hardware generally costs more per unit of capacity than the middle.
  • Resizing is an operational event. It typically requires a failover or restart.

Read replicas are the first horizontal step. They scale reads by copying the log to followers, but they do not scale writes, since every replica must apply every write. They also introduce replication lag, which breaks read-your-writes semantics: a user who updates their address and immediately reloads the page may read the old value from a replica. The system now needs routing rules ("read from the primary for N seconds after a write") or session-level consistency tokens.

Sharding is the only way to scale writes past one machine. Partitioning by a key (tenant, user, order ID) gives each shard its own primary and its own serialized path. The sharding vs replication distinction matters: replication copies the same data to scale reads and improve availability; sharding splits data to scale writes and storage. Most large systems do both.

Sharding introduces costs that never fully go away:

  • Partition key choice becomes permanent architecture. Queries that do not include the key become scatter-gather fan-outs.
  • Cross-shard invariants require distributed coordination. A transfer between accounts on different shards needs two-phase commit, a saga with compensating actions, or a redesign so the invariant lives on one shard.
  • Hot keys defeat partitioning. One very large tenant still lands on one shard.
  • Rebalancing moves live data. It must be done while serving traffic, with care for in-flight writes.

Caches: memory ceilings and hot keys

A single cache node is bounded by memory and, for engines like Redis, by largely single-threaded command execution. Scaling it vertically buys memory but not necessarily throughput.

A cache cluster partitions keys across nodes. Redis Cluster, for example, maps keys to 16,384 hash slots distributed across primaries. Consistent hashing schemes give a useful property: adding a node to an N-node ring remaps roughly 1/(N+1) of keys, whereas naive hash(key) mod N remaps most of them.

That property matters because remapped keys are cache misses, and a miss storm hits the database at the moment you were trying to add capacity. Scaling the cache can briefly overload the system it protects.

Horizontal scaling does not fix a hot key. If one product page receives a large fraction of reads, it lives on one node regardless of cluster size. The fixes are structural: key replication, local in-process caching with short TTLs, or request coalescing so concurrent misses trigger a single backend fetch.

Storage: object stores scale out by design, block storage does not

Object storage is horizontally partitioned internally, which is why it absorbs very large aggregate throughput. The tradeoff surfaces as per-prefix or per-partition request limits, higher per-request latency than local disk, and no in-place partial updates.

Network block volumes typically carry per-volume IOPS and throughput ceilings, so a database on one volume can hit a storage limit before a CPU limit. Local NVMe offers much lower latency but ties data durability to a single host, which pushes durability up into replication at the database layer. Each option places the durability boundary somewhere different, and the architecture must know where.

Enjoying this so far?

Join thousands of engineers receiving practical engineering, Cloud, Distributed Systems, Infrastructure and AI engineering insights.

No spam. Unsubscribe anytime.

An Example Architecture with Explicit Scaling Boundaries

Consider a hypothetical multi-tenant commerce platform. The diagram matters less than the annotation of how each component scales.

Clients
  |
  v
Load Balancer                     [scale-out, stateless]
  |
  v
API Service (N instances)         [scale-out, stateless; bounded DB pools]
  |        \
  |         \
  v          v
Cache Cluster     Orders DB Primary   [cache: scale-out by key]
(hash-slotted)    (vertical)          [DB: scale-up; single writer]
                    |       \
                    |        v
                    |     Read Replicas  [scale-out reads; lagging]
                    v
               Outbox Table → Event Relay → Message Queue
                                               |
                                               v
                                          Worker Pool     [scale-out; idempotent]
                                               |
                                               v
                                         Object Storage   [scale-out by design]

State ownership. The orders primary owns the authoritative order and inventory state. The cache holds a derived, possibly stale copy. Workers own nothing durable; they transform events into side effects.

Consistency boundary. Inventory reservation and order creation commit in one local transaction on the primary. The outbox pattern writes the event in that same transaction, so the database and queue cannot disagree about whether an order exists. The relay may publish an event more than once, so workers must be idempotent.

Scaling boundaries. Everything above the primary scales out freely, so the API's aggregate connection count must be capped (per-instance pool size × max instances ≤ what the database can handle), or a connection pooler must sit in front of the primary. The queue decouples workers from request latency, but it converts overload into lag; consumer lag must be a monitored, alerted quantity, not an invisible buffer.

Evolution path. When write volume approaches the primary's ceiling, the natural seam is the tenant ID. Since nearly every query is tenant-scoped, sharding by tenant keeps transactions local. The large-tenant problem is handled by allowing a dedicated shard for outliers.

This design deliberately scales up the one component where coordination is the point, and scales out everything that can avoid coordinating.

Scale Up vs Scale Out: Tradeoffs and a Decision Framework

DimensionVertical (scale up)Horizontal (scale out)
CoordinationIn-process, nanoseconds, implicitOver network, milliseconds, explicit
CeilingHard hardware limitCoordination cost (USL β), not hardware
Cost curveSteepens at the top tierRoughly linear per node, plus coordination overhead
Failure domainOne large blast radiusSmaller units; partial failure becomes normal
Headroom for failureNeeds a full standbyN nodes surviving one loss run at most (N-1)/N of capacity
ConsistencySimple; local transactionsReplication lag, cross-node invariants, ordering
Operational complexityLow day-to-day; resizing is disruptiveHigher steady state; capacity changes are routine
RecoverySlower as the machine growsFaster per node; rebalancing adds its own risk

The headroom row deserves attention. Two nodes that must survive one failure can each run at only 50% of capacity. Ten nodes can run near 90%, though the queueing math above suggests not running at 90% anyway. Horizontal scaling improves capital efficiency at larger N, but it cannot repeal queueing behavior.

A practical decision framework asks these questions in order:

  1. Is the bottleneck parallel or serialized? If profiling shows lock waits, log flushes, or a single hot partition, more cores or more nodes will not help. Remove the serialization first.
  2. Does the workload partition cleanly? If nearly every operation touches one key (tenant, user), scale-out is natural. If invariants span arbitrary entities, scale-out will require distributed transactions or a redesign.
  3. What is the availability requirement? A single vertically scaled node with a replica can meet many availability targets. Requirements for surviving zone or region loss force horizontal distribution regardless of throughput.
  4. How far is the ceiling? If growth projections stay comfortably within mid-tier hardware for the planning horizon, vertical scaling is usually the cheaper, safer choice.
  5. Who will operate it? A sharded cluster requires rebalancing tooling, cross-shard observability, and people who understand it. That cost is real and recurring.

Neither strategy is "correct." Vertical scaling buys simplicity with a ceiling; horizontal scaling buys a higher ceiling with permanent coordination cost.

Failure Modes and What Happens at Scale

The failure profile changes as load grows. The numbers below are illustrative.

At 10 requests per second, almost any architecture works. A single application server and a single database with a backup are correct. Sharding here is pure cost: more failure modes, more operational surface, no benefit.

At 1,000 requests per second, the stateless tier is horizontally scaled, and failures become partial. One instance with a slow DNS resolver or a degraded disk serves slow responses while health checks still pass. Read replicas introduce stale reads. Connection pools and timeouts start to define the system's behavior under stress, and retry policy matters: three retries with no backoff can quadruple load on a dependency that is already struggling.

At 100,000 requests per second, coordination dominates. Cache resharding triggers miss storms. A hot tenant saturates its shard while others sit idle. Rebalancing competes with production traffic. Clock skew affects lease-based leadership. Membership changes (nodes joining or leaving) become constant events rather than exceptions, and the cluster's control plane, its failure detector and routing metadata, is itself a distributed system that can fail.

Across all scales, the most dangerous failure is not a node crash. It is a component that is slow but alive, because it holds resources upstream while appearing healthy. Scale-out systems have more of these components, so they need explicit timeouts, bounded queues, and load shedding to fail fast rather than fail slowly.

Engineering Principles for System Design Scalability

Scaling compute does not solve a serialized bottleneck. Identify the serialized fraction before buying hardware or nodes. Amdahl's Law sets the ceiling either way.

Scaling out moves coordination onto the network. Every invariant that crosses a node boundary now costs a round trip and can fail partially. Design so that most invariants stay local.

Scaling a stateless tier increases pressure on the stateful tier. Aggregate concurrency against a database must be bounded by design, not by hope.

Partition by the key your invariants already use. A good shard key makes most transactions single-shard. A bad one turns every request into a distributed query.

Replication scales reads and availability; partitioning scales writes and storage. Confusing the two leads to adding replicas for a write bottleneck.

Headroom is part of the scaling strategy. The number of nodes determines how much capacity must sit idle to survive a failure.

Prefer vertical until a specific constraint forces horizontal. That constraint might be the hardware ceiling, an availability requirement, or a workload that partitions naturally. Absent one of those, distribution is complexity without a return.

Final Thoughts

The horizontal vs vertical scaling decision looks like a capacity question, but it is really a question about where coordination lives and what it costs. A larger machine coordinates cheaply and invisibly until it hits a physical wall. A cluster has no single wall, but every interaction between its parts becomes slower, explicit, and subject to partial failure.

Experienced engineers treat scaling as a property of each component's relationship to state. Stateless work scales out almost for free. Coordinated state scales up first, then out along the seams where invariants naturally divide. The architecture follows from understanding which is which, and from knowing which bottleneck the system will hit next, before it does.

These are the kinds of engineering problems at the center of modern software systems: understanding where state lives, how components coordinate, and what happens to a system when its growth outpaces the assumptions it was built on.

Key Takeaways

  • Vertical scaling keeps coordination inside one machine at memory speed, while horizontal scaling moves coordination onto the network, where each step is orders of magnitude slower and can fail partially.
  • The Universal Scalability Law shows that pairwise coordination cost can make a cluster slower as it grows, so the practical ceiling of scale-out is coordination, not hardware.
  • Autoscaling a stateless API tier multiplies connections and concurrency against the database, so aggregate connection limits must be designed alongside the scale-out policy.
  • Read replicas scale reads and availability but not writes, and they introduce replication lag that breaks read-your-writes semantics unless routing accounts for it.
  • Sharding is the only way to scale writes beyond one primary, but it makes the partition key a permanent architectural decision and turns cross-shard invariants into distributed coordination problems.
  • Adding cache nodes does not fix hot keys, and resharding a cache can cause a miss storm that overloads the database it was protecting.
  • A system with N nodes that must survive one failure can use at most (N-1)/N of its capacity, so node count directly determines how much headroom sits idle.

Get insights like this in your inbox

Join thousands of engineers receiving practical engineering, Cloud, Distributed Systems, Infrastructure and AI engineering insights.

No spam. Unsubscribe anytime.