0
0
HLDsystem_design~12 mins

Vertical scaling vs horizontal scaling in HLD - Architecture Patterns Compared

Choose your learning style9 modes available
System Overview - Vertical scaling vs horizontal scaling

This system explains two ways to increase computing power: vertical scaling and horizontal scaling. Vertical scaling means making one machine stronger by adding more resources. Horizontal scaling means adding more machines to share the work.

Key requirements include handling more users or data smoothly and choosing the right scaling method based on cost, complexity, and fault tolerance.

Architecture Diagram
          +----------------+                     +----------------+
          |   User Client  |                     |   User Client  |
          +-------+--------+                     +-------+--------+
                  |                                      |
                  |                                      |
          +-------v--------+                     +-------v--------+
          | Load Balancer  |<------------------->| Load Balancer  |
          +-------+--------+                     +-------+--------+
                  |                                      |
        +---------+----------+                 +---------+----------+
        |                    |                 |                    |
+-------v-------+    +-------v-------+ +-------v-------+    +-------v-------+
| Server Node 1 |    | Server Node 2 | | Server Node 3 |    | Server Node 4 |
| (Vertical     |    | (Vertical     | | (Horizontal   |    | (Horizontal   |
|  Scaling)     |    |  Scaling)     | |  Scaling)     |    |  Scaling)     |
+---------------+    +---------------+ +---------------+    +---------------+
        |                    |                 |                    |
        +---------+----------+                 +---------+----------+
                  |                                      |
          +-------v--------+                     +-------v--------+
          |   Database     |                     |   Database     |
          +----------------+                     +----------------+
Components
User Client
client
End user device sending requests
Load Balancer
load_balancer
Distributes incoming requests to servers
Server Node 1
service
Single powerful server with vertical scaling
Server Node 2
service
Another powerful server with vertical scaling
Server Node 3
service
One of multiple servers in horizontal scaling
Server Node 4
service
Another server in horizontal scaling cluster
Database
database
Stores application data
Request Flow - 7 Hops
User ClientLoad Balancer
Load BalancerServer Node 1 or 2 (Vertical Scaling)
Load BalancerServer Node 3 or 4 (Horizontal Scaling)
Server Node 1 or 2 or 3 or 4Database
DatabaseServer Node 1 or 2 or 3 or 4
Server Node 1 or 2 or 3 or 4Load Balancer
Load BalancerUser Client
Failure Scenario
Component Fails:Server Node (Vertical Scaling)
Impact:If the single powerful server fails, the service becomes unavailable until fixed.
Mitigation:Use horizontal scaling with multiple servers to avoid single points of failure.
Architecture Quiz - 3 Questions
Test your understanding
Which scaling method adds more machines to handle increased load?
ACaching
BHorizontal scaling
CVertical scaling
DLoad balancing
Design Principle
This architecture shows how vertical scaling strengthens a single server by adding resources, while horizontal scaling adds more servers to share load. Horizontal scaling improves fault tolerance by avoiding single points of failure, whereas vertical scaling is simpler but limited by hardware capacity.