[System Design] Vertical Scaling — In a Nutshell (with OOP Code)
The basic idea of the vertical scaling is to add more resources to the existing system in order to super-size it and to meet the expectations.
Consider the below system,
And Code Snippets,
Client: Code
Server: code
Now, the server is currently strong enough to take 5K requests at most.
In order to scale up the system vertically, we need to increase the Server’s strength, so that it will be able to take more requests, for example, 10K or 15K at most.
Possible Design Solutions
- Increase the threshold limit.
OR
Drawback: Heap Issues with the time.
2. Chain the Servers: Once you get the request, if not possible to serve it, Send it to chained Server. (Actual scaling vertically)
Since Server 1 is exposed to the client, in order to maintain the decoupling and extensibility in the system, we need to make sure that all requests and responses should have to be driven through Serve 1 or Master server.
Drawback:
- Increase Response time.
- Also, the headache of managing request chaining increases with the increase in client count.
There is one more design solution for scaling vertically. if you know, do comment.
Advantages of Vertical scaling :
- Reduced software costs.
- Easy Implementation.
Major Disadvantages of Vertical Scaling:
- Limited Scaling.
- The risk for downtime is much higher than horizontal scaling.
- Greater risk of outages and hardware failures.
- Finite scope of upgradeability in the future.
Code Source: