Forage: AWS Virtual Experience Program

Arin Chowdhury
3 min readApr 17, 2022

--

Designing a simple, scalable, hosting architecture

Hi Lilly,

Thank you so much for your mail.

I’ve prepared an architecture diagram that illustrates how you can leverage more AWS services to improve your application’s current performance, allow for future growth, and improve your deployment process.

It is based around Elastic Beanstalk which brings together HTTP load balancing, application servers and database servers under one umbrella. After setting up these services using Elastic Beanstalk, they can be scaled independently. For example, we can increase the resources available to the database server without affecting the app server and vice versa.

Please find a system architecture diagram attached to this email. I will explain these parts in details and why they are chosen.

Route 53 Hosted Zone

We will set up your DNS in AWS Route 53, AWS’s DNS management system. This will allow your DNS to tie into the load balancer and make routing changes automatically.

Elastic Beanstalk

Your application will be deployed to Elastic Beanstalk. Simple command lines tools are provided to deploy your application. You may have to make a few small changes to your code configuration for it to work on Elastic Beanstalk but we can provide guidance on that. We also consider Code Pipeline which could assist with deployment.

The Elastic Beanstalk environment is in three parts: Elastic Load Balancer, EC2 Compute instances and an RDS PostgreSQL server.

Elastic Load Balancer

When setting up Elastic Beanstalk we can also have it set up a load balancer for us. This allows traffic to be routed to different EC2 instances in one or more availability zones. This provides redundancy and scaling.

EC2 Auto Scaling Group

The main benefit of using Elastic Beanstalk is the way it ties into EC2 to automatically scale the number of instances your application runs across. We can set up rules to automatically add or remove instances as the load on your application increases. This will help if your application has peak times where the load is greater as you would only be paying for capacity when you need it.

RDS PostgreSQL Server

Elastic Beanstalk can automatically set up and manage the PostgreSQL database in RDS too.

The benefits of running PostgreSQL on a separate server from your application have already been covered above.

S3

We can utilize S3 for RDS backups of your files. In the future we can also consider serving static files or media from S3 if your application grows to require this.

Multiple Availability Zones

To provide more redundancy, we can set up the application in multiple availability zones (AZ). An extra RDS instance can be set up which the production instance replicates to. You may find that with the other improvements that you don’t need another AZ too, as obviously there is extra cost involved.

Code Pipeline

As your application gets more users from all over the world you will find it harder to set up maintenance windows to allow downtimes during deployments. We can use Blue Green deployments to launch a new Elastic Beanstalk instance for a new version that’s deployed. The existing production environment is called the Green environment and the previous production environment can be stopped.

This can be a manual process, or Code Pipeline can be configured to work with Elastic Beanstalk to perform this automatically. This would take the place of an existing CI/CD pipeline if you already use one.

After some initial performance testing to get a baseline figure we can decide what size instances to start with. This will then allow us to estimate costs going forward.

Some costs will be roughly the same every month. For example, your RDS instance price is fixed until its moved to a smaller or larger instance. Similarly, if you were to run the same sized EC2 instance(s) for the whole month the cost of them is the same regardless of the number of requests. Other components, such as the load balancer accure costs with more requests.

When we have a better picture of the number of requests you will be servicing, and the resources require for these. We will work with you and use the AWS pricing calculator to get concrete pricing numbers.

Please let me know if you need any more information.

Kind regards,

Arin Chowdhury

--

--

Arin Chowdhury
Arin Chowdhury

Written by Arin Chowdhury

Creating Fantasies based on Science, a Story teller.

Responses (1)