Before diving into vertical scaling, let's first discuss what actually we mean by "scaling".
Vertical Scaling
Suppose we have developed a web server for a cool project. Initially, the traffic was steady and manageable. Users were enjoying the features, and everything was running smoothly. However, one fine day, our project went viral on social media, and suddenly, the traffic spiked to unprecedented levels. The server struggled to handle this massive influx of users.
In response to this unexpected surge in traffic, a straightforward solution is to increase the processing power of the server so that it can handle this increased traffic. This increase in processing power is called "Vertical Scaling".
In vertical scaling, the resources of a single server, such as adding more CPU, RAM, or storage. In the context of our scenario, we quickly upgraded the server by adding more processing power and memory to cope with the increased demand. This allowed our web server to efficiently manage the skyrocketing traffic and ensured a seamless experience for users.
Advantages
Simplicity: It is simpler because we have to upgrade the hardware of a single server. No need to reconfigure or distribute the load across multiple servers.
Short-term cost effective: For a short term, upgrading a single server's hardware is cost effective than building a distributed system.
Single Point of Maintenance: Since, there's a single machine that is involved, maintenance tasks, such as updates and patches are generally simpler than a distributed system.
Disadvantages
Limited Scalability: While scaling, we'll eventually reach a point where we have maxed out the limit of hardware upgrade we can do and we are stuck and its impractical or too expensive for further upgrades.
Downtime: To perform upgrades/maintenance the system has to be shut down, which leads to downtime.
Hardware Dependency: In vertical scaling, the application performance is directly related to the capability of a single machine.
Distributed Application: Vertical scaling is not suitable for cases where, there is a need of high computation, parallel processing or geographical distribution.
Scenarios where vertical scaling is good
Database Workloads: Vertical scaling is good for database servers. Increasing the computational power of a db server helps in speeding up the performance especially in the case where a single powerful server can handle the workload efficiently.
Legacy Systems: In situations where rewriting or restructuring an application for horizontal scaling is impractical, vertical scaling can be a quick and effective solution
Small to Medium Workload: For applications with workload ranging between small to medium can be handled by a single server, vertical scaling is a cost-effective and straightforward solution.
Spiky Workloads: In cases where an application experiences occasional workload spikes, vertical scaling is a straightforward solution.
Small Businesses: For small businesses/startups with budget constraints, vertical scaling is more cost effective initially.