Skip to content
Back to all concepts
ScalingDistributed SystemsCloud

Horizontal Scaling (Scaling Out)

The definitive guide to adding more servers to your infrastructure pool and testing the bottlenecks that limit growth.

By ScaleWikiUpdated 3 min readIntermediate

Horizontal Scaling (Scaling Out)

Horizontal scaling, or "scaling out," involves adding more machines to your resource pool rather than upgrading existing ones. Instead of one "Super Server," you have a fleet of commodity servers.

The Cloud Native Way

This is the standard pattern for modern web applications like Google, Facebook, and Amazon. It treats hardware as a commodity—cattle, not pets.

Core Components

To achieve horizontal scaling, you introduce new infrastructure components:

  1. Load Balancer: The traffic cop. It sits in front of your server fleet and distributes incoming requests across healthy nodes.
  2. Stateless Applications: Your servers cannot store user session data locally (in memory). If User A sends Request 1 to Server 1, and Request 2 to Server 2, Server 2 must know who User A is. Shared storage, signed session tokens, or carefully designed affinity can address this; Redis is one option, not a requirement.
  3. Distributed Databases: You can't just clone your API servers if they all talk to one choked database. First measure the bottleneck; query tuning, batching, caching, Replication, or Sharding solve different constraints.

Advantages

1. More aggregate capacity

Adding nodes helps when work can be partitioned. Shared databases, coordination, skew, quotas, and network capacity limit growth. Ten times the servers does not automatically deliver ten times the useful throughput.

2. Resilience and Redundancy

If Server #402 crashes, the Load Balancer detects the failure and stops sending it traffic. Requests in flight can still fail. Health checks, retries, spare capacity, and connection draining are needed for graceful failover and rolling updates.

3. Cost Flexibility

You can match supply to demand. At 3 AM, you might run 2 servers. At 8 PM peak, you might run 50. You only pay for what you use.

The Complexity Tax

Horizontal scaling introduces Distributed System problems:

  • Network Latency: Services talk over the network (RPC/REST), which is slower than in-memory function calls.
  • Data Consistency: The CAP Theorem dictates you must choose between Consistency and Availability during partitions.
  • Operational Overhead: Managing many servers creates more failure modes and coordination work. You need robust logging, monitoring (Distributed Tracing), and deployment pipelines.

Comparison

FeatureVertical ScalingHorizontal Scaling
CostDepends on instance and bottleneckIncludes extra nodes and coordination
Failing NodeAn outage if there is no failoverSurvivable only with spare capacity and redundancy
ComplexityLowHigh
LimitHardware and per-process limitsShared resources and coordination limits

Further Reading

Sources and verification

See Google SRE: Handling Overload for why per-request resource cost matters. Use the capacity lab to compare a warm-cache estimate with a node failure and cold cache, then validate those scenarios with a representative load test.