DEV Community

Winson
Winson

Posted on

Horizontal and Vertical scaling

Scalability is being able to handle more request and both vertical and horizontal scaling handle these request differently. Horizontal scaling has multiple servers that receive the request but vertical scaling has only one big server that handles them. In this article I’m going to share with you the good and bad of these scaling.

Alt text of image

Horizontal scaling has what’s called load balancing so if one of the servers fails then the load balancer redirects the request to other servers and if a new server is added the load balancer will start to send requests to it. This ensures that the client request are reliable by sending request to working servers, it’s working efficiently with multiple servers, and it provides flexibility by increasing or decreasing the number of servers. Since vertical scaling is only one huge server this can’t be done.

The bad thing about vertical scaling is that it has hardware limits. Yes you can add more resources like cpu/ram/disk capacity to your server but it’s not enough if you have large users. This is why horizontal scaling is ideal for big companies because they can add more servers if the demand is needed and its scaled well as users increase.

Now the good thing about vertical scaling is that it has data consistency. This is because there is only one system where all the data resides. Having a horizontal scaling where transaction send data across multiple servers can get complicated and is harder to maintain. This can be impractical especially if you had a transaction where the operation had to be atomic causing it to lock all servers and data.

When deciding which scaling to use its best to decide which one is most suitable for your needs. If you’re running a small company and don’t expect many users/data to increase then having a vertical scaling can be ideal for you. If you’re working with a large company where there are increase in users then using horizontal scaling is the way to go.

Top comments (0)