Skip to content
We areTOP 1%

What is the difference between vertical and horizontal scaling?

EasyConceptScalability & Performance
Track your progress
First attempt
Re-solve after a few days
Final pass before interviews

Answer

Vertical scaling (scaling up) adds more CPU, memory or disk to a single machine. Horizontal scaling (scaling out) adds more machines and spreads the load across them, usually behind a load balancer.

  • Vertical: simple and needs no code changes, but it is limited by the largest available machine, becomes expensive at the top end, and leaves a single point of failure.
  • Horizontal: capacity grows almost linearly and the system tolerates machine failures, but it needs stateless services, load balancing, and data partitioning or replication.
  • In practice: start vertical because it is cheap and simple, then scale out the stateless tiers first; databases are the hardest tier to scale horizontally.

More in Scalability & Performance

Sign in to track your progress

Your checkboxes, streak and activity heatmap are saved to your account and sync across devices. It is free.
Sign in with email

New here? Create an account