Horizontally vs Vertically Scaling
The scalability of an application can be measured by the number of requests it can effectively support simultaneously. The point at which an application can no longer handle additional requests effectively is the limit of its scalability.
Horizontal and vertical scaling are similar in that they both involve adding computing resources to your infrastructure. There are distinct differences between the two in terms of implementation and performance.
Horizontal scaling means scaling by adding more machines to your pool of resources, whereas vertical scaling refers to scaling by adding more power (e.g. CPU, RAM) to an existing machine.
In choosing between the two, there are various factors to consider. These include:
Performance - Scaling out allows you to combine the power of multiple machines into a single virtual machine with the combined power of all of them. This means you’re not limited to the capacity of a single unit.
Flexibility - If your system is solely designed for scaling up, you are effectively locked into a minimum price set by the hardware you are using. If you want the flexibility to choose the optimal configuration setup at any time to optimize cost and performance, scaling out might be a better option.
Regularity of Upgrades - Building an application as a single, large unit will make it more difficult to add or change pieces of code individually without bringing the entire system down. In order to deliver a more continuous upgrade process, it’s easier to decouple your application and horizontally scale.
Redundancy - Horizontal scaling offers built-in redundancy in comparison to having only one system in vertical scaling, and thus a single point of failure.
Geographical Distribution - When you need to spread out an application across geographical regions or data centres in order to reduce geo-latency or handle disaster recovery scenarios.
Cost - As more large multi-core machines enter the market at significantly lower price points, A single box and will meet your performance and scalability goals. This might lead to reduced costs.