Horizontal and Vertical Scaling
Horizontal scaling changes the number of resource instances, while vertical scaling changes the capacity of an individual instance.
Download Markdown (.md)Soroush’s Product Wiki · https://wiki.soroush.uk/topic/horizontal-and-vertical-scaling/
01What it means
Horizontal scaling, or scaling out and in, adds or removes instances that share a workload. Vertical scaling, or scaling up and down, changes an instance’s resources, such as memory or CPU capacity. Either can be manual or automated; neither guarantees that the application or its dependencies can use the added capacity effectively.[1][2]
02Why it matters
The choice affects cost, operational complexity, availability during changes, and the maximum workload a system can handle. A team needs to know whether its bottleneck is a resource ceiling or a design that prevents work from being distributed.
03When to use it
Use this comparison when a measured capacity constraint requires more resources. Vertical scaling can be simpler when a workload needs one larger node; horizontal scaling suits distributable work. Evaluate storage, sessions, consistency, and downstream limits before assuming instances can be added safely.
04How it works
- Locate the bottleneck and identify the resource it consumes.
- Check whether more capacity on one instance will relieve it.
- Assess whether work and state can be distributed across instances.
- Compare resizing interruption, provisioning delay, quotas, and ongoing costs.
- Test both growth and safe capacity reduction under representative traffic.
05A practical example
A search service adds stateless workers horizontally during peak traffic. Its database initially scales vertically for more memory, because extra search workers cannot fix cache misses there. The team measures both layers rather than applying one scaling method everywhere.
06Where it breaks
Vertical scaling has hardware and service limits and may require interruption. Horizontal scaling introduces coordination, routing, and state-management problems. Scaling actions take time and can overload dependencies or lose unfinished work if scale-in is careless.
Common mistakes
- Assuming more application instances increase database capacity.
- Treating horizontal scaling as automatically fault tolerant.
- Removing instances before their work is drained or safely transferred.
07Sources
- AutoscalingMicrosoft · Official documentationAutoscaling
- Scalability - Deploying Oracle SOA Suite 12c on AWSAmazon Web Services · Official documentationScalability - Deploying Oracle SOA Suite 12c on AWS