juniorscalability
Horizontal — add more servers. Vertical — increase the power of a single server.
Vertical (scale up): more CPU/RAM/SSD on one server. Simple, but has physical limits and creates a SPOF. Horizontal (scale out): add instances behind a load balancer. More complex (stateless, distributed state), but virtually unlimited.
When yes
Horizontal — for stateless services with high RPS. Vertical — for databases with sharding limitations
When no
Vertical — when already on the maximum instance. Horizontal — for stateful apps without shared storage
Interview tip
Always start with horizontal, then explain when vertical is better (databases)
Alt:Auto-scaling groupsServerless