How to Cloud - The many ways to Scale a website

November 8, 2022

  1. Vertically scale the website - increase the server capacity by adding more memory, CPUs (or vCPUs), storage and bandwidth - no longer recommended with cloud computing.

  2. Deploy the app to Elastic Beanstalk (EB) - Elastic Beanstalk is a managed hosting service from AWS. You simply push the code and the service manages everything from hosting, setting up the database and scaling up/down the servers based on traffic - best for most users and those not comfortable with managing or logging into servers.

  3. Auto Scaling group and load balancer - Create an Auto Scaling group (ASG) for your servers. An ASG looks for a threshold that you specify, and if the threshold is crossed, it adds more servers to your system. When the threshold is no longer met, it automatically scales back the servers. A load balancer, placed in front of the servers distributes traffic among the servers. This approach is best for intermediate to advanced developers as it requires some server wrangling.

  4. Containerize the app and scale your containers - Containerize the app into a docker image, push the image to Elastic Container Registry on AWS and from there, you can deploy containers to Elastic Container Service, Kubernetes or Fargate. This approach requires knowledge of docker, registries and docker deployment and is more involved than approaches 2 and 3. Best of sites with a lot of traffic (hundreds of thousands of concurrent users).

  5. Migrate asynchronous tasks to serverless functions: This approach isn’t always possible, but if your website is decoupled between frontend interface and backend APIs, serverless, or Lambda functions are an alternative to servers and containers. No servers or containers to maintain is a plus. But there is a learning curve to building serverless functions. If you have a sprawling monolith of a website you could just port over the long running or asynchronous logic like emails, image processing, reporting, shipping and financial calculations to lambda functions - leaving your server/container to handle only synchronous tasks.

Did I leave out anything? Please let me know - @sandeep_gopal or drop me an email