One of the key aspects that made cloud popular is scalability , that means you can increase or decrease your resources at any given time. Now, if you are new in cloud, the question that might disturb you is why we want an application with fluctuating resources rather than fixed resources. The answer is simple, to save MONEY !
There is no definite number how much we can save by moving our solution to cloud but a quick example could give you a good understanding of how much we are actually wasting when we stick with on premise solution. Lets start with a traditional scenario (S.S.C result publication) when a huge number of incoming request comes to website during the result publication time, to handle these extra incoming request you could expand your CPU cores, ram but such expanding cost is huge! Plus it does not make any sense to spend this huge amount of money only to handle these extra spikes which literally stays only for two or three days in a year.
Another good example could be a a line-of-business (LOB) application that is expected to be online only during business hours. Cloud providers usually charge their service by hour. Since only 64-65 hours of availability are needed per week, that mean we could save money for (24*7-65 hours) 103 hours at least in each week just by removing extra instances. In fact, if the application is designed properly removing all compute nodes/instances for certain time periods is possible.
The above figure shows if you setup your infrastructure just by watching analysis report of one week or so how wrong you would be in the long run.
There are mainly two types of scaling.
- Vertical Scaling
- Horizontal Scaling
Vertical Scaling (aka Scaling Up) :
Adding extra hardware like processing power, RAM, storage etc. to your system is called Vertical Scaling. The best part of this type of scaling is that your data resides in one place and in its addition you don’t have to take the hassle to manage multiple instance. The negative side with this sort of scaling is first its not cost effective and secondly you have to deal with the configuration manually.
Horizontal Scaling (aka Scaling Out) :
In cloud you handle the extra spikes by increasing the instance number instead of buying new servers. Cloud provider ensures your data and apps are available from all instances immediately. When you have low load in server you could scale down your resources by removing the extra instance. Thus, you only ever have the infrastructure you need and pay no more then what you need. This type of scaling is called Horizontal scaling.
I like horizontal scaling because i don’t want to waste even a single penny and I know in cloud its much simpler to exploit extra capacity. I just have to scale it in either direction to fit my need. This will minimize the overall cost because after releasing a resource, I do not have to pay for it beyond the current rental period until I am in need to spin new instance again (in future).
The following figure shows a side by side comparison between vertical and horizontal scaling –
|Vertical Scaling||Horizontal Scaling|
|Physical Limitation||Resource of a single host||Resource of a Cluster|
|Additional software license||Low||High|
|Other concerns||No coordination overhead||Need load balance and gateway|
Heads Up :
At the time of scaling proper attention has to be taken on managing user session state.
Each and every single web application has a capacity limit. Based on the number of visitors the performance of our web app either increases or decreases. So, to ensure a good stable performance for visitors we have to scale in/out our server capability regularly. While adding new infrastructure is a solution that could handle this issue, increasing/decreasing the number of instance is another solution.
Good Read :