Vertical vs Horizontal Scaling
What You Will Learn
Understand the two basic ways to increase system capacity.
Core Idea
Vertical scaling means making one machine stronger.
Small Server -> Bigger ServerHorizontal scaling means adding more machines.
Load Balancer
/ | Server Server ServerHorizontal scaling is often useful for stateless application servers because traffic can be distributed across multiple instances.
A Simple Mental Model
Client
|
v
Application
|
+--> Database
|
+--> Cache
|
+--> Background WorkerDo not worry about building every component at once. System design is mainly about understanding why a component exists, what problem it solves, and how components communicate.
Practical Example
Suppose one API server handles 500 requests per second and traffic grows.
Instead of immediately buying a much larger machine, you might run several application instances:
Load Balancer
|
+-- API 1
+-- API 2
+-- API 3The database and other shared resources may then become the next bottleneck.
Key Points
['Vertical scaling is simple but has hardware limits.', 'Horizontal scaling increases the number of instances.', 'Stateless applications are easier to scale horizontally.', 'Scaling one component can expose another bottleneck.']
Common Beginner Mistakes
- Adding technologies before understanding the problem.
- Designing for millions of users when the requirements do not justify it.
- Ignoring failure cases.
- Treating every system as if it needs the same architecture.
- Focusing on diagrams instead of explaining the decisions behind them.
Quick Summary
The goal of this lesson is to build a simple mental model that you can reuse in future designs.
Next, you will learn how a load balancer distributes traffic.