Scalability in the Cloud: Vertical vs Horizontal Scaling


What is Scaling?

Scaling is a process that alters the size of any system by expanding or compressing it to meet the expectation. The scaling operation can be achieved by adding resources to the existing system or by adding a new system with the existing one. Scaling can be done to the servers On-Premise or on the cloud. In this article, we will be going through scalability in the cloud

What is Cloud Scalability?

The 4 pillars of Cloud Computing are

  • Scalability
  • Elasticity
  • Fault Tolerance
  • High Availability

Cloud scalability is one of the important pillars of cloud computing as seen above. It is the ability to increase or decrease the system resources to meet the changing demands. Storage capacity, processing power, and network can be scaled in the cloud without any downtime to the application whereas it would take weeks or months with on-premise infrastructure.

This is one of the major factors for the success of the cloud as companies can scale up / down their infrastructure on demand without maintaining their own hardware. Netflix has a huge user base and serves them based on the demand by deploying its applications in AWS.

Cloud Scalability vs Cloud Elasticity

There is often a misconception between Scalability and Elasticity. Elasticity is the ability of a cloud to expand or compress the infrastructural resources automatically on a sudden-up and down in the requirement so that the workload can be managed efficiently.

There are differences between both of them as shown below

Benefits of cloud scalability

Key cloud scalability benefits driving cloud adoption for businesses large and small:

  • Convenience
  • Flexibility and speed
  • Cost Savings
  • Disaster recovery
  • Reliability
  • Capacity

Types of Cloud scalability

There are 3 types of scaling namely

  1. Vertical Scaling (Scale-up)
  2. Horizontal Scaling (Scale-Out)
  3. Diagonal Scaling (combination of Vertical and Horizontal Scaling)

What is Vertical Scaling?

As seen in the above diagram, Vertical scaling retains the existing infrastructure by adding more compute power. By scaling up, you increase the capacity of a single machine and increase its throughput. It means adding more resources to a single node and adding additional CPU, RAM, and DISK to cope with an increasing workload. Basically, vertical scaling gives you the ability to increase your current hardware or software capacity but the important to note is that you can only increase it to the limits of your server.

Drawbacks of vertical scaling

  • A major drawback of vertical scaling is there is a higher risk of downtime and outages as the server needs to restart to upgrade the infra.
  • Vertical scale can cost more in general if the resources are not sized correctly

What is Horizontal Scaling?

As seen in the above diagram, Horizontal Scaling refers to adding more machines or nodes to the existing infrastructure to cope with the increase in demand. It is similar to delegating the workload among several employees in an organization. It differs from Vertical Scaling by adding more resources by adding new machines instead of adding more resources to the existing infrastructure.

Drawbacks of Horizontal scaling

  • The costs might be higher depending on the number of instances you need, your costs may be higher.
  • It is a bit complicated to maintain a lot of instances when compared to maintaining the same instance in vertical scaling

What is Diagonal Scaling?

Diagonal scaling helps to combine horizontal and vertical scaling in cloud computing. With diagonal scaling, we get the flexibility of adding up more resources both vertically and horizontally according to the needs. When there is a surge in traffic, the requirements are met. When traffic decreases, the configuration goes back to normal. Diagonal Scaling is also provided by the cloud providers

Difference between Horizontal and Vertical Scaling

When to use Horizontal and Vertical Scaling

There are many factors to be considered when choosing between the 2 strategies

  • Performance — Horizontal Scaling(Scaling out) provides us a high performance by combining the power of multiple machines into a single virtual machine with the combined power of all of them. However, it is worth considering if there is enough resource within a single machine to meet the scalability needs.
  • Flexibility — Scaling out might be a better option for the overall system flexibility
  • Regularity of Upgrades — Again, flexibility is important here. Building an application as a single large unit will make it more difficult to add or change pieces of code individually without bringing the entire system down. In order to deliver a more continuous upgrade process, it’s easier to decouple your application and horizontally scale.
  • Redundancy — Horizontal scaling provides built-in redundancy in the system. This is very useful for read-only databases (read replicas) to perform analytics. Vertical scaling is a single point of failure.
  • Geographical Distribution and Disaster Recovery — Having the application to serve users in different geographical regions, Horizontal Scaling is needed. Even for disaster recovery, Vertical Scaling won’t work
  • Cost — These days, large multi-core machines come at significantly lower price points and if they can achieve the scalability goals by providing enough resources, then Vertical Scaling could be a cost-effective option here.

There are some scenarios where you need to consider Diagonal Scaling which gives the benefit of both worlds.

In this article, we have seen what is Cloud Scalability and the different types of Scaling — Vertical, Horizontal, and Diagonal. We have studied all these 3 and then compared Vertical and Horizontal Scaling.

Hope you found this article interesting and thanks for reading.!!!

I work as a freelance Architect at Ontoborn, who are experts in putting together a team needed for building your product. This article was originally published on my personal blog