Horizontal vs vertical scaling?
Options
- Horizontal: a bigger machine; vertical: more machines
- Horizontal: more machines; vertical: a bigger one (Correct option)
- They are the same thing under two different names
- Vertical scaling needs a load balancer to work
Answer
Horizontal: add more machines; vertical: add CPU/RAM to one machine
Why
Vertical scaling (scale up): give one server more CPU, RAM or disk. Simple, no code changes, but there is a maximum size and that one server is still a single point of failure.
Horizontal scaling (scale out): add more servers and spread the traffic with a load balancer. It can grow much further and survives a server dying, but the app must be designed for it (e.g. stateless servers).
Remember
Vertical = bigger machine. Horizontal = more machines.