links: System Design MOC
What is Horizontal Scaling?
Horizontal scaling is a technique where you use multiple smaller systems as a pool.
What is Vertical Scaling?
Vertical Scaling is where you use a system which has more processing power (basically a more powerful machine than the current one)
Pros and Cons of Horizontal and Vertical Scaling
| Horizontal Scaling | Vertical Scaling |
|---|---|
| Scales Linearly (as user increases or decreases number of machines can be scaled according to that) | Can be scaled upto some extent |
| Load Balancing Required | Load balancing not required |
| Resilient to failure | Single point of failure |
| Network calls is slow (RPC) as data communication has to be from one system to another | Inter process communication |
| Data Inconsistency (example to make ACID for transaction) | Consistent |
In Real World we use both Horizontal and Vertical Scaling.
Suggested approach would be start with Vertical Scaling and move to Horizontal Scaling.
A Best system design will take best of the both worlds
- Resilient (Horizontal Scaling)
- Scaling (Horizontal Scaling)
- Consistency (Vertical Scaling)
- Inter Process Communication (Vertical Scaling)
tags: scaling system-design source:
- [https://www.youtube.com/watch?v=xpDnVSmNFX0&list=PLMCXHnjXnTnvo6alSjVkgxV-VH6EPyvoX&index=1](Horizontal vs Vertical Scaling by Gaurav Sen)