Vertical vs. Horizontal Scaling

Vertical scaling gives a machine more CPU, RAM, or I/O capacity. It is operationally simple until hardware limits, cost, or maintenance constraints become problematic. Horizontal scaling adds instances and can improve throughput and fault tolerance, but requires load distribution, shared or partitioned state, and coordination.

Stateless application servers are comparatively easy to scale horizontally. Local in-memory sessions, uploaded files, and scheduled jobs tied to one process make scaling harder unless state is externalized or ownership is coordinated.

Scaling out does not fix every bottleneck. A shared database, hot key, global lock, or external API quota can remain the limiting component. Measure the end-to-end critical path and scale the constrained resource rather than adding application instances blindly.

Key Takeaways
  • Stateless services are easier to scale horizontally.
  • Find the bottleneck before adding capacity.
  • Horizontal scaling introduces coordination and state-management questions.
Knowledge Check

Why are p95 and p99 latency useful alongside average latency?