DEV Community

Cover image for Scalability web application
Tiago Rosa da costa
Tiago Rosa da costa

Posted on

Scalability web application

Scalability is the capacity the application handles growth access number, users and handler data volume without affecting user experience.

If you search about scalability in web applications, you will probably find someone with: vertical scalability and horizontal scalability, you can think what is it first moment? Easy my friend, keep going, I will explain to you what I know about this theme.

Vertical scalability

This scalability type where you increment hardware resources in the machine where running your application. Increase hardware resources with: cpu, ram and disk to handle growth access number, users and data volume.

The image below describe the vertical scalability well:

Image description

Increasing the hardware resources of a machine is relatively easy when you are using IAAS(infrastructure as a service) with AWS, Azure and DigitalOcean, because you access the specified service and change machine settings in a few minutes.

But has some points you need warning:

  • Exist the hardware resource limit you can increment one machine
  • If there is some problem on the machine or in the data center where the machine is put. Your application can't be accessed.
  • Sometimes you have a big machine, but no need for all hardware resources, you need only moments of peak access.

Horizontal scalability

This scalability type where you increment machine numbers where each machine has an application running to handler growth access number, users, data volume.

Has one component very important that is load balancer responsable distribuite request between machines with application web running.

The image below describe horizontal scalability well:

Image description

In this case only creating one machine with an application is when the ready load balancer sends a request to this new machine.

One thing very interesting this scalability type if you settings yours machines in diferentes availability zones(AWS concept) you have fail torelancy, because if one machine or data center
has some problems if your application keeps running because there exist other machines in other availability zones(AWS concept).

If some IAAS with AWS has autoscaling, that is one service that allows increment or decrement number machines automatically based on some settings. For example: when the machine group reaches 80% cpu usage, create a new machine, and when it reaches 30% cpu usage remove one machine.

But has points you have warning:

  • If your application uses sessions authentication is necessary, enable sticky sessions on load balancer.
  • If your application has upload of files is necessary, use services with S3 to storage your files, because if you store in disk the machine sometimes can have problems. For example: you have 2 machines, you make request load balancer send you to machine 1, you store file machine 1 disk, moments later you can need get file stored but you request load balancer send to machine 2 where don’t have this file in disk and to resolve this problem you some service with S3.

Vertical scalability or horizontal scalability? Which is better?

Your application has a fixed access number customer and the application don’t will grow up, so vertical scalability. If you don’t have a certain access number and can increment access number, users and data volume, so horizontal scalability.

Top comments (0)