When a system is large, the data in the system is bound to be large. And over time, the data is increased continuously which makes it difficult to manage. With the intention of good data management in the system, the resources are maintained. Let’s see an example of an e-commerce app that sells organic foods only. Earlier, when people were not aware of the benefits of organic foods, the app was rarely used but with time, people began realizing the importance of the food and the app started becoming famous. The app began receiving huge traffic to the point where it feels like it’s losing functionality. The solution to this issue is adding infrastructures in the app so that the functionality increases to handle the load. This is called Scaling.
The formal definition of scaling is the ability to add or remove resources to accommodate the increasing or decreasing demand of operations. The point where the requests for the operation in the system reach their limit is known as the scalability limit.
Types of scaling
There are two types of scaling: -
1. Vertical Scaling
2. Horizontal Scaling
The first kind of scaling is vertical where we upgrade the existing machine to improve the application capability. This can be done by increasing hardware capacity, i.e., additional CPU, memory, and disc space. The general infrastructure and the design of the app remain the same.
We can also address Vertical Scaling as Scaling up. The most common examples are MySQL and Amazon RDS. It is typically used in small and mid-sized companies.
Pros of vertical scaling
- Simple Implementation process
- Easier to manage
- Data consistency
- No data-partitioning
- Less administrative effort
- Lessened software costs
- Less power consumption
- Maintained application compatibility.
Cons of vertical scaling
- Replacing or upgrading the server takes time which results in high downtime.
- Hardware failures and outages are highly possible
- Future upgradeability has a limited scope.
- Implementation cost is very expensive.
- Limited scaling
- The potential for network I/O or disk I/O is limited.
Unlike vertical scaling, we add machines to the system instead of upgrading the already existing ones. This helps to distribute the load (load balancing) which ultimately improves the system’s performance. If availability is the highest priority for your system, then horizontal scaling is your go-to add-in. In addition, it has an advantage over vertical scaling on downtime since the load is distributed.
This is also known as the scale-out approach. Load Balancing is very effectively used by increasing I/O concurrency, reducing the load on existing nodes.
Pros of horizontal scaling
- Redundancy increment
- Better Fault Tolerance
- Flexible and Efficient
- Easily Upgradeable
- More efficient utilization of smaller systems.
- Enhanced resilience with multiple systems
- Lower downtime when compared with vertical scaling
Cons of horizontal scaling
- Architectural designs are complicated
- Data partitioning is required.
- Big impact on data centers
- Additional networking pieces of equipment are required. (Switches, Routers, etc.)
- Utility cost is high (cooling and electricity)
- Licensing fees are expensive
- Data inconsistency
- Downstream services have increased loads.
Difference between vertical and horizontal scaling
How to choose between Vertical and Horizontal scaling
Horizontal scaling opens your horizon with multiple machines which enhances the performance.
Horizontal scaling has built-in redundancy.
Horizontal scaling is preferable if you want flexibility in your system.
4. Regularity of upgrades
Since vertical scaling limits your upgrading limits, horizontal is more upgradeable.
5. Geographical distribution
If you want to distribute your data in the system according to geographical location to reduce latency and comply with regulatory standards or to handle disaster recovery scenarios, horizontal scaling is a good option rather than having a single node in vertical scaling.
If your system requirement can be handled in a single node with consistent data, vertical scaling might save you money.
There might be a debate while choosing between horizontal and vertical scaling and the better idea would be having the option for both. Microservices architectures have more important features to discuss than scalability but if horizontal scalability is added, it can have better capacity elasticity than monolithic architectures.
However, the most efficient advantage will be obtained when both vertical scalability and horizontal scalability are available.
I hope this article was helpful to you.
Please don’t forget to applaud this article and follow me!!!
Any kind of feedback or comment is welcome!!!
You can also subscribe to my stories via email so that you’ll get notified whenever I bring out an article on a new subject.
Thank you for your time and support!!!!
Keep Reading!! Keep Learning!!!