Compare vertical and horizontal scaling and when each is the right choice.
basicVertical scaling makes one machine bigger (simple, bounded, single point of failure); horizontal adds machines (near-unbounded, needs statelessness or partitioning, adds distributed-systems complexity).
- Vertical first when load fits one big node: no data partitioning, ACID intact, easiest ops.
- Horizontal for stateless tiers (trivial behind an LB) and when data or traffic exceeds a single node or you need fault tolerance.
- Stateful tiers scale horizontally via replication (reads) and sharding (writes/data).
- What makes an app server horizontally scalable? Statelessness: sessions in Redis/JWT, no local files, idempotent handlers.
- Is horizontal always cheaper? No, coordination, network and operational costs can exceed a bigger box.