As our application grows, we need to scale our system to handle increasing traffic and load. Two popular strategies to achieve this are vertical scaling and horizontal scaling.
Vertical Scaling
Vertical Scaling is also referred to as
scale up
. In this, we add more resources to the existing machine like adding more RAM, faster CPU, etc.It's good for simple architecture because there is a limit, we can't add unlimit amount of RAM or CPU to a single machine.
It does not have a failover if it does down our complete application goes down.
Horizontal Scaling
Horizontal scaling is also referred to as
scale out
. In this, we add more machines to spread the load across multiple machines.It's considered effective for large-scale systems.
It does have a failover if a single machine goes down, It will not affect our application much because it can be distributed across other machines.
We will be required to add a load balancer to distribute the load across different machines.
Choosing between vertical and horizontal scaling depends on the needs of your application. Vertical scaling is easy but limited, while horizontal scaling offers more flexibility and resilience for large-scale systems.