Horizontal vs Vertical caling: What’s the Best Approach for Scalable Architecture?

What is Scalability in Software Systems?

Scalability means increasing/decreasing application resources as per demand. These resources are required to handle increased load on the system or to improve the system’s performance.

Now whenever an application is deployed on a given server(Machine) we expose our program via a certain protocol over a given network for people to use. In our example suppose we are using a client-server architecture with a request and response framework where clients are making requests to a given server and requests are being completed with a response over the network.
As the load and traffic will increase with the no of requests we have to improve our infra to serve those requests. There are 2 ways to do it first we upgrade our machine and second increase no of machines we have.
These 2 ways are known as Vertical Scaling or Horizontal Scaling

Scaling
Scaling

Types of Scaling: Vertical vs Horizontal

What is Vertical Scaling?

Vertical Scaling or Scaling up means increasing capabilities on single Server, Means increasing the memory(RAM), processing speeds(CPU), and improving hardware.

Key Benefits of Vertical Scaling-

  • Recommended when traffic growth is predicatable
  • Easier Management as involves single Server
  • Data Consistency is easy on single server

What is Horizontal Scaling?

Horizontal Scaling or scaling out means you are increasing no of machines in the server network/Infrastructure .

Key Benefits of Horizontal Scaling:

  • Resiliency – Since no of machines increases there will be no single point of failure.
  • Scalability – We can scale as per our needs there is no limitation
  • used in Cloud Applications and Distributed applications.

Trade-offs Between Horizontal and Vertical Scaling

CharacteristicsHorizontal ScalingVertical Scaling
No of MachineSingle machineMultiple Machines
BalancingN/ALoad Balancing Is required
ResiliencySingle Point of failureHighly Resilient
Data ConsistencyConsistentInconsistent
ScalingLimitedUnlimited
Network callsInter process communicationRemote Procedure Calls
Horizontal Scaling vs Vertical Scaling

Choosing the Right Scaling Strategy

There’s no one-size-fits-all solution when it comes to scaling. Choice depends on your needs, traffic ad goals.

  • Use Vertical Scaling when consistency is utmost importance and with predictable traffic .
  • Use Horizontal Scaling when Scalability is needed with unpredictable traffic .

Conclusion (What is ideal then ?)

Well given the trade-offs there is no ideal solution to this problem it depends on the individual requirements of the system.
Generally, its mixture of both means good from both approaches like Consistency & Interprocess Communication from horizontal scaling and Reslienecy and unlimited scaling from horizontal scaling.


Comments

One response to “Horizontal vs Vertical caling: What’s the Best Approach for Scalable Architecture?”

  1. […] thedevopsguy.co.in in Blog System Design Next Post Prev Post […]

Leave a Reply to 2. Load Balancer – The Devops Guy Cancel reply

Your email address will not be published. Required fields are marked *