.NET Architecture & System Design Interview Question #7
What is the difference between vertical scaling and horizontal scaling?
Architecture Fundamentals, Scalability, Availability & Performance Junior Beginner
Quick Interview Answer
Vertical scaling increases the capacity of one machine, for example by adding CPU, memory, or faster storage. Horizontal scaling adds more machines or application instances and distributes work among them.
Detailed Explanation
Vertical scaling increases the capacity of one machine, for example by adding CPU, memory, or faster storage. Horizontal scaling adds more machines or application instances and distributes work among them.
Vertical scaling is often simpler but has practical limits and can preserve a single point of failure. Horizontal scaling can improve capacity and resilience but usually requires stateless processing, load distribution, and coordination of shared state.
Code Example
Vertical:
Server -> bigger Server
Horizontal:
-> App 1
Load Balancer -> App 2
-> App 3