Skip to main content

Horizontal Scaling

Pronunciation
hor-ih-ZON-tul SKAY-ling
Updated 2 min read

Share this page

Send the link, quote the definition with a link back, or show it as a card on your own site.

https://softwaredictionary.org/terms/horizontal-scaling

In short

Horizontal scaling (scaling out) increases a system's capacity by adding machines and spreading the work across them, rather than making one machine bigger.

What is horizontal scaling?

When a web application gets more traffic than one server can handle, you can run it on two servers, then ten, with a load balancer sharing requests between them. Each server does the same job on a different part of the load. Cloud platforms make this easy: autoscaling groups and Kubernetes add and remove instances automatically as traffic rises and falls.

Scaling out has big advantages. Capacity can grow almost without limit, a single machine failing doesn't take the service down, upgrades can roll through instances one at a time without downtime, and many small machines can be cheaper than one giant one. Large internet services run on thousands of commodity servers for exactly these reasons.

It does require the right design. Application servers should be stateless, keeping sessions, uploads and caches in shared services such as Redis or object storage, so any instance can handle any request. Databases are harder to scale out: read replicas spread reads, but spreading writes means sharding the data, which complicates queries, transactions and operations.

A common misconception is that adding servers always adds speed. Shared bottlenecks, such as a single database, a lock or a slow external API, cap throughput no matter how many app servers you add, and coordination between nodes adds its own overhead. Measure where the bottleneck is before scaling out.

Key takeaways

  • Horizontal scaling adds more machines and spreads the load.
  • A load balancer and autoscaling distribute traffic across instances.
  • It brings near-unlimited growth, fault tolerance and rolling upgrades.
  • Servers must be stateless; databases need replicas or sharding.
  • Shared bottlenecks limit gains, so measure before scaling out.

Readers ask

What is the difference between horizontal and vertical scaling?

Horizontal scaling adds more machines; vertical scaling makes one machine more powerful with more CPU, memory or faster storage. Horizontal scaling grows further and tolerates failures, while vertical scaling is simpler but hits hardware limits.

Why must servers be stateless to scale horizontally?

If a server keeps a user's session in its own memory, the next request must reach the same server. Moving state to a shared store lets the load balancer send any request to any instance and lets instances be added or removed freely.

Can databases scale horizontally?

Yes, with more effort. Read replicas handle more reads, and sharding splits data across servers to handle more writes. Some distributed databases, such as Cassandra or CockroachDB, are designed to scale out from the start.

Often compared

See also

Spotted a mistake or something missing on this page?Suggest an edit

Read a random page
Open today's review
Switch to the dark theme
Read this page in Türkçe

More

Settings