Deploy a 3-tier Python-Django based Chat Application. Tier 1 - Web Server (Nginx) Tier 2 - Application Server/Backend (Python Django) Tier 3 - Database (MySQL)A few pointers:

  1. The application needs a database (MySQL)
  2. Application is written in the Python Django framework. You need to look into how to set up the Python Django Environment to run/deploy these applications.
  3. For a web server, you need to set up a Reverse Proxy Web Server - Nginx. One more important point:
  4. For the backend, make sure you are using Ubuntu 22.04 version of AMI.
  5. The Application supports python 3.8 version. Make sure you install the correct one.
  6. How would you handle overwhelming load in this ? follow the documentation below.

Basic infrastructure that we are going to follow for our application.

image.png

VPC Configuration

image.png

We begin by setting up a custom Virtual Private Cloud (VPC) to isolate our application resources.

This VPC provides a private networking environment for the 3-tier architecture. It allows us to define custom subnets, routing, security groups, and ensures better control over traffic flow between the application tiers (webserver, backend, and database).

The CIDR 10.0.0.0/16 provides a large IP range (65,536 addresses), ideal for creating multiple subnets. It ensures flexibility for tier separation and future scaling.

Subnet configuration

image.png

I’ve created 4 subnets within the my-vpc to separate resources across public and private layers, ensuring both accessibility and security: