Horizontal vs Vertical Scaling

Spread the love

One of the core concepts of System Design is System Design and scalabilty is somthing which should be thought upon when designing an system.

So what is scalability?

It is the ability to handle more requests by buying more machines.

To buy a bigger machine, it is called vertical scaling. To buy more machines, it is called horizontal scaling.

Now let’s see the characteristics of each.

Horizontal

1) Load balancing is required for this architecture.

2) It is very resilient.

3)Increase in Networks calls due to multiple machines.

4)It will scale well if users increase with the addition of new machines.

5)Also a chance a data inconsistency if multiple machines are involved with their own JVM’s or you can say environments.

Vertical

1)No concept of load balancing since it is a single system or server.

2)It is a single point of failure. So if that server fails, everything stops.

3)Inter process communication is possible so no network calls.

4)There is a hardware limit unlike horizontal scaling where multiple machines can be added whenever required.

5)Data consistency is quite guaranteed as it is an single environment.

So as per your requirement, you can choose horizontal or vertical scaling.

In horizontal, you get a better scalability in case of a failure. If one server fails, the requests can go to a different server. Also it performs well with the increase in the usage and no of users.

In vertical, there is better perf with inter process communication and data consistency guaranteed.

Choose the one best for your application.

Thank for reading.