Performance & Scalability interview question · Most asked
What is the difference between vertical and horizontal scaling?
Summary
Vertical scaling adds resources (CPU, RAM) to one machine; horizontal scaling adds more machines behind a load balancer. Vertical is simpler but has hard limits and a single point of failure; horizontal scales further and improves availability but requires stateless services and distributed coordination.
Longer Answer
Stateless application servers scale horizontally easily; databases are harder (replicas, sharding). Start vertical where it's cheap, design for horizontal scaling of the stateless tier from the beginning.
Key Points
- Vertical: bigger machine
- Horizontal: more machines
- Stateless services scale out
- Databases need special strategies
More most-asked Performance & Scalability questions
- What's the difference between latency and throughput?
- How do you approach a performance problem methodically?
- How do load balancers work, and what algorithms do they use?
- Why are timeouts, retries and circuit breakers essential for performance and reliability?
- What are the most common database-related performance problems?