System Design BASICS: Horizontal vs. Vertical Scaling
·1 min
Table of Contents
Scalability is basically the ability of a system to handle more requests. Specifically it is the ability of a system to handle increased load without degrading performance or service quality. It involves designing systems that can accommodate growth, whether in data, traffic, or complexity.
There are two types of scaling, Vertical Scaling and Horizontal Scaling.
1. Vertical Scaling: #
- With increased load you decide you make your computer bigger.
- Adding more resources to the existing nodes in a system, like more CPU or memory.
2. Horizontal Scaling: #
- Here you buy more computers instead.
- Adding more node to a system, like more servers in a cluster.
Pros vs Cons: #
Vertical | Horizontal | |
---|---|---|
Load Balancing | Required | N/A |
If Node Fails | Resilient | Single Point of Failure |
Communication | Network calls (RPC) | Interprocess |
Data Consistency | Inconsistent | Consistent |
Hardware Limitation | Scales well as users increase | Limited |
So what do companies use in the real world? Both!
We like like Vertical Scaling because it is resilient and is not limited by it’s hardware, so it scales well as users increase. We like Horizontal Scaling because Interprocess communication is fast and the data is consistent.
The major considerations are is it Scalable, is it Resilient and is it Consistent.