Scaling a monolithic application

While at a larger scale, most applications have a unique architecture, they usually start the same way as our Hello World app with a simple monolith.

There are two common ways to scale a monolithic application:

  • Scaling it vertically, meaning using bigger EC2 instances such that you get an instance with more CPU, more memory, and better network performance
  • Scaling it horizontally, meaning adding more and more EC2 instances running the same code and load balancing the traffic across them

Scaling vertically is, of course, the easiest approach when it comes down to handling more traffic, but because we are trying to solve both the performance and the redundancy issues, we need to include the horizontal scaling component to our scaling strategy. In addition, you may remember the "just-in-time infrastructure" concept explained in Chapter 1, The Cloud and the DevOps Revolution, that allows Amazon and many other start-ups to provision just enough servers to handle the traffic present on their site at any given time. This dynamic scaling concept can easily be implemented in AWS when using a horizontal scaling strategy thanks to a service called Auto Scaling groups.

In the following section, we are going to revisit our stack. We will first add a load balancer and an Auto Scaling group to our web servers. After that, we will update our CodeDeploy configuration to target that new set of instances.

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

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