This module covers how to design systems that perform consistently as demand increases.
Suppose you have a server which has 4 GB of RAM and you have deployed your web application over there. Initially you had few users ranging from 100 to 200, so it was working smoothly. Soon your website gain popularity, and suddenly you hit a spike of few thousands users and your server is not scaled to handled such spike, so what happens? The server will crash.
In such situations scaling helps us to design a system which will handle sudden increase in demand.
What is Scaling?
Scaling refers to the ability of a system to handle growth тАУ whether it's increasing traffic, more data, or higher workload demands. A scalable system can expand its capacity without compromising performance or requiring a complete redesign.
There are two primary types of scaling.
1 Vertical Scaling (Scaling UP)
In our website example as the website gain popularity and users increased to 10000 then we have two options of scaling first one is vertical scaling, in this we increase the power of the server for example initially the server had 4GB of RAM, then we can increase it to 8GB to handle the spike. This is known as vertical scaling, it is not limited to RAM, we increase the CPU, RAM or storage.
After some time our server hit 1 lakh users, and our 8GB server overwhelmed with such spike. So we can increase the RAM again, however ultimately we will hit the limitation of the technology, it is not possible that we keep increasing the resources, as we are constrained by the technology, we can't give infinite power to a single system.
So, in that we use the other type of scaling which is Horizontal Scaling.
2 Horizontal Scaling (Scaling Out)
In this instead of adding more resource to the server, we add more servers or machines to the system to distribute the load across multiple units. This approach is more complex but is often essential for sytsems that need to scale dynamically.
Leave a comment
Your email address will not be published. Required fields are marked *