Vertical Scaling and Horizontal Scaling in Cloud: The Difference
Whenever we hear about cloud hosting, the first thing that pops up to our mind is ‘Scalability’. Scalability, as you might be aware, is the ability to modify or expand the configuration in order to contain the load. The high scalability of cloud hosting makes it different from other hosting types and because of this many large businesses choose cloud hosting providers so that their website will be flexible, high-performing, and will be available to their customers. Moreover, the performance will not be affected even if the website is receiving a hefty chunk of traffic since cloud servers can scale the resources according to the needs. Adding to that, the pay-per-use model of cloud hosting makes it different from other hosting types. As we said earlier, mostly large businesses opt for cloud hosting. This is not just because the cloud offers excellent scalability but in fact, it is something imperative from a business perspective since the competition is fierce nowadays and people only go with websites that perform well.
The scaling in the cloud is done in two ways viz; Vertical scaling and horizontal scaling. For beginners in server administration, this can be a wee bit confusing. Let’s see how different vertical scaling and horizontal scaling are.
Vertical Scaling
Vertical scaling refers to upgrading or adding the resources of the existing machine. So, if you have one CPU and you add 2 more CPUs, then it’s called vertical scaling. It shouldn’t be necessarily CPU, it can be any resources. Upgrading the RAM from 8 GB to 16 GB can is also vertical scaling. However, vertical scaling can only go as long as the machine has enough room to expand.
To make things more clear, let’s take a real-life example.
You took a new house. There are two bedrooms out of which one is for your two children and the other is for you and your wife. Over time, one of your children gets engaged and then you realize there is no space for an extra member. Ergo, you expand your house by adding a room. This is vertical scaling. In technical terms, you would be upgrading the CPU, RAM, etc just like adding a room to the house.
Horizontal Scaling
When the in-house resources are upgraded in vertical scaling to contain the load, a new machine is added with the existing machine in horizontal scaling. This means more resources and more nodes to alleviate the load.
Let’s see an example to get a clearer picture.
Imagine you are planning to go on a trip with your friends. There are 10 members including you but unfortunately, there is only one car which can contain a maximum of 5 members. Therefore, to include the remaining members, you take a car for rent. This is literally known as horizontal scaling.
This is precisely what happens in horizontal scaling. Your requirements enhance and you require double of the resources you currently have. Hence, you acquire a new machine.
Both vertical scaling and horizontal scaling are often used. However, in vertical scaling, there is a limit to scale since there is a limit in expanding the resources. Whereas horizontal scaling doesn’t have many limitations and that is why many opt for it for large software and applications.