Horizontal Vs Vertical Scaling

·

3 min read

Let’s understand this using an example. You are an event manager who’s responsible for a concert that is going to take place in a week. According to the previous year’s data, you decide to book a ground that can accommodate ten thousand people. Let’s assume that the performing artist fandom has increased manifold this year, and people are getting mad to see his performance, and it’s evident that more than ten thousand people are going to show. Here comes the concept of scalability; you are aware of the limits of your ground, and now you need to scale up the holding capacity to accommodate everyone.

So how do you scale the ground to accommodate everyone? Do you search for a larger ground? or Do you combine four to five grounds and place speakers in every ground? The first case where you search for the larger ground is vertical scaling, whereas the second case is an example of horizontal scaling.

Vertical Vs Horizontal Scaling

So basically, vertical scaling means increasing the capacity of your system by adding more power to your current system. Horizontal scaling, on the other hand, refers to adding more nodes to increase the capacity of your system. So what will you choose for your system to scale the system? Well, it depends on many factors, especially what requirements your system has. Let’s compare them.

  1. Load Balancing

When you have more than one node, you need to distribute the workload properly so that there is minimal lag and every node gets an equal amount of work. Hence, horizontal scaling needs a load balancer that manages the load, whereas there is no need for a load balancer in vertical scaling.

2. Resilience

One of the major problems with vertical scaling is of Single Point of Failure. If the system fails, you don’t have any backup. Horizontal scaling provides us with resilience, meaning it can handle failure as there are other nodes to function if one of the nodes fails!

3. Interaction/ Calls between System

To communicate between nodes in horizontal scaling, Network calls are made, whereas vertical scaling is simple Interprocess communication which is faster.

4. Data Consistency

It is quite logical to see why there is Data Consistency in Vertical Scaling, as there is a single data point. In contrast, there is a chance of Data Inconsistency as there are multiple nodes and data points in Horizontal Scaling.

5. Hardware Limitations

Don’t you think that vertical scaling has a fundamental problem of reaching saturation? You keep increasing the computation power of a single machine, but there has to be a point where it will become almost impossible to go further. This is the hardware limitation of Vertical Scaling, which is not the case for Horizontal Scaling, which scales well.

Hope you learned, keep reading, and keep sharing!