In this Yellow Coding tutorial, we’re going to see the differences between Horizontal and Vertical scaling. with a quick introduction and examples.

Scalability:

The ability of a system to continue to perform normally under load. This load can be an increase in the number of users or requests.

Horizontal

Vertical

It refers to adding more hosts or computers as the number of users increases. It refers to adding more memory, RAM,

increase the processor speed all in a single host or a computer of the existed pool.

Load Balancing is required.

(System must incorporate a component that spreads traffic among the machines equally)

Not necessary.
Resilient to System failure.

which means that if one machine is powered off, other machines can handle its requests.

Single Point of failure.
Utilizes Network Calls.

(We have many machines involved in Horizontal Scaling, so the communication between them is done through the Network calls, which makes it a little slow)

Interprocess communication while on the other side we have a single machine and it uses Inter-Process Communication, which is quite fast.
Data Inconsistency

Let’s say in Horizontal Scaling, machines are communicating with each other and tasks might be dependent, like machine 1 sends data to machine 2, then machine 2 sends it to machine 4, here, you can see that data is complicated to maintain, so if this kind of transaction is happening, what happens is that we have to lock all the databases, which is impractical and because of which we have this issue of loose transactional guarantee and this is called Data Inconsistency, which is quite a big issue. While it’s not the case in Vertical Scaling.

Data Consistent
Scales well.

The Very important point, there’s gonna come a point when you just can’t upgrade your existing computer, it’s the Hardware Limit, In this scenario, Horizontal Scaling Scales well as the number of users increases.

 Hardware Limit.