1.Horizontal vs vertical scaling
Vertical scaling means moving to a bigger machine — more CPU, more RAM, on the same single instance. Horizontal scaling means adding more machines and spreading the work across them. They solve the same problem — not enough capacity — in structurally different ways.
Key features
- Vertical scaling: upgrade one instance to more CPU/RAM/disk — same architecture, bigger box
- Horizontal scaling: add more instances and distribute load across them
- Vertical scaling has a hard ceiling — the largest machine a cloud provider or vendor sells
- Horizontal scaling has no such ceiling, in principle, but requires the workload to be distributable
- Vertical scaling usually needs no code change; horizontal scaling requires load balancing and, often, statelessness
Vertical vs horizontal scaling
- Vertical (scale up)
- One instance, bigger CPU/RAM/disk
- Hard ceiling — the largest machine available
- Usually no code change needed
- Horizontal (scale out)
- More instances, load balanced
- No hard ceiling, in principle
- Needs a distributable workload, often statelessness
Command
vertical: 1 instance, size ↑ (CPU, RAM, disk)
horizontal: N instances, N ↑ (load-balanced)Vertical scaling means a bigger machine and has a hard ceiling; horizontal scaling means more machines and has (in principle) none, at the cost of needing a distributable workload.