What is scalability?

Has this ever happened to you:, you created an application that worked well in a controlled test environment but when it got deployed to the production environment, parts of the application stopped responding? Or the application works well for the first few days, when the load or number of users is low, but as the load increases, the application stops responding or slows down? These are very common scenarios if you created an application without thinking about the scalability aspect of it.

So, what exactly is scalability?

Scalability can be defined as the ability to scale your operations as per increases in demand. With respect to a computer system, it would mean the application adapting to increased load. I would say this definition is simple, crisp, and covers the gist, but it is still a bit incomplete. The explanation given for scalability talks about handling increased demand, but what about decreased demand? Let's hold on to that thought. We will come back to it later but first, let's consider a case of increased demand and scalability.

Let's take a case; there is a website that handles 1,000 users daily. We have a fixed Linux server of a specific capability that is happily handling this load. Let's leave out the database, application server, other tools, and technology-related complexity for now. Assume that slowly and steadily, the website is getting popular and the number of users doubles. But we realize the machine we have deployed it on is not able to handle this load and chokes. You could handle the situation by adding more power to the machine or moving to an upgraded one. Say we used 8 GB of RAM earlier and we moved to 16 GB RAM, that would solve our problem.

Next, we see an increase in load and we again double the capacity. This is called vertical scaling, which is where we add more power to our machine and the same instance of the application handles more load. This is good, but requires manual effort and is not cost-effective. We know that having a high-end server machine is costlier than having two low-configuration machines. To take advantage of this concept, we would like to be able to add more instances of our application and get better performance than by adding more power to the same machine. This is called horizontal scaling.

So, for the purpose of this book, we will define scalability as the ability of the system to adapt to increased or decreased demand, with the optimum use of resources available.

Note that I am also emphasizing a decrease in demand. This is one aspect that can be neglected when we talk about scalability. This is understandable, as everyone would like to think of scenarios where the applications are becoming popular and the load is increasing. But in the real world, we have to deal with temporary loads at times; for example, an e-commerce site would see a heavy load for an online sale period. That's why, when I started discussing scalability, I mentioned that you should architect for scaling down along with scaling up. At the end of the day, we do not want to pay for resources that we are not using.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.139.86.18