paint-brush
What You Need To Know About Vertical and Horizontal Scalingby@mirza
121 reads

What You Need To Know About Vertical and Horizontal Scaling

by Mirza BilalJanuary 21st, 2024
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

In the ever-expanding digital empire, a multitude of apps and solutions emerge with the intent to simplify human lives and boost productivity. Organizations want to optimize their infrastructure for cost-effectiveness without compromising on quality of service. No infrastructure can remain stagnant, and inevitably, there comes a time when scaling is essential to match these growing needs.
featured image - What You Need To Know About Vertical and Horizontal Scaling
Mirza Bilal HackerNoon profile picture

In the ever-expanding digital empire, a multitude of apps and solutions emerge with the intent to simplify human lives and boost productivity. As the demand grew, cloud services have been proactive in providing a diverse array of options to cater these needs. Organizations strive for a cost-effective infrastructure without compromising on quality of service.


The need to efficiently scale infrastructure has never been greater. No infrastructure can remain stagnant, and inevitably, scaling is needed to match these growing needs. In this article, I will discuss the idea of horizontal and vertical scaling, delving into the details of each approach. This writing aims to provide insights into which scaling strategy and which methodology will best suit your specific requirements. Thus helping you make the informed decisions to fulfill infrastructure needs.

Vertical Scaling

Picture a house that meets your needs comfortably. Life is good; everything fits adequately within the available space. However, as your family grows and your lifestyle evolves, the need for additional space becomes apparent. To address this demand, you opt to extend upwards and add more floors to meet your expanding requirements.


Let's draw a parallel to this housing expansion in terms of cloud infrastructure. Imagine you have an AWS C6g.large instance with 2 vCPUs and 4GiB of Memory to process PDF documents. It has served you well for a while, but as your product gains more traction, the demand for processing PDFs increases and now you need more computational power.

To address this demand, you replace C6g.large instance with a larger one, like C6g.xlarge with 4 vCPUs and 8GiB of memory. This upgrade effectively adds more "floors" to your digital dwelling, theoretically allowing you to process twice as many PDFs as compared to the previous instance. This phenomenon of replacing a smaller instance with a larger one is termed as "Vertical Scaling" in the cloud computing landscape.


Horizontal Scaling


Imagine the same scenario where your home has become insufficient to match your growing needs. However, instead of stacking more floors onto the existing structure, you decide to build or buy an adjacent building.


Let's relate this house expansion strategy with the increasing processing capability of cloud computing where your C6g.large instance is insufficient to process ever-increasing PDF document processing.


Instead of replacing the existing instance with a larger one, you adopt a different strategy. You decide to add another C6g.large instance to your computing arsenal. Each instance operates independently but contributes to the overall processing power. This concept of adding replica instances is known as "Horizontal Scaling" in the cloud computing realm.


Conclusion

Vertical and Horizontal Scaling both strategies play a crucial role in optimizing computational resources. Vertical scaling, with its simplicity in enhancing power without altering workloads, offers a straightforward approach for immediate performance improvements. On the other hand, horizontal scaling stands out in cloud computing for its remarkable flexibility, allowing easy adjustment of resources to meet fluctuating demands.


However, the most effective solutions often emerge from a hybrid approach: optimizing an instance through vertical scaling to align precisely with targeted workload requirements and then employing this tailored size within a horizontal scaling framework. This combination harnesses the strengths of both vertical and horizontal scaling, providing a robust and adaptable infrastructure for various computing needs.


Also published here.