Horizontal vs Vertical
- Horizontal scaling (scale out/in) — add/remove instances. Scales without limit; requires a stateless application
- Vertical scaling (scale up/down) — increase/decrease the power of a single server (CPU, RAM). Simpler, but has a ceiling
Trigger metrics
- CPU: above 70% → add an instance
- Memory: above 80% → scale up
- RPS / Queue depth — application-specific
The stateful problem
Auto scaling only works for stateless applications. Sessions and cache must live in external storage (Redis), not in process memory.