Building a Three-Tier Architecture with AWS Services

Building a Three-Tier Architecture with AWS Services

Introduction

In modern cloud applications, a Three-Tier Architecture is a fundamental approach that enhances scalability, security, and performance. This blog walks you through building a three-tier architecture using AWS EC2, RDS , and Application Load Balancer (ALB) within VPC with step-by-step guidance and images.

What is a Three-Tier Web Architecture?

A three-tier architecture consists of three distinct layers:

  1. Web Tier – Handles client requests and serves the front-end website.
  2. Application Tier – Processes API requests and business logic.
  3. Database Tier – Manages data storage and retrieval.

Each tier is isolated to improve scalability, security, and fault tolerance.

Step 1: Creating Your VPC (My-VPC)

Why?

A Virtual Private Cloud (VPC) provides an isolated network for deploying resources securely.

Steps:

  1. Navigate to the AWS VPC Dashboard.
  2. Click Create VPC and configure: My IPv4 CIDR Block: 192.168.0.0/22
  3. Create Subnets: Public Subnets (for Web & ALB): 192.168.0.0/24, 192.168.1.0/24,Private Subnets (for App & Database): 192.168.2.0/24, 192.168.3.0/2
  4. Create an Internet Gateway and attach it to the VPC.
  5. Set up Route Tables:Associate public subnets with a route to the Internet Gateway.



Article content
Creating a VPC


Article content


Article content
Subnets


Article content
Route Tables

Step 2: Creating Security Groups

Why?

Security groups act as virtual firewalls, controlling inbound and outbound traffic for resources.

Steps:

  1. Web Server Security Group: Allow HTTP (80) and HTTPS (443) from the internet, Allow SSH access from a trusted IP., Allow outbound traffic to the application tier
  2. Application Server Security Group: Allow inbound traffic only from the web tier,Allow outbound traffic to the database tier.
  3. Database Security Group:Allow inbound traffic only from the application tier,Deny all public access.


Article content
📌Security Groups

Step 3: Setting Up the Database Tier

Why?

The database tier provides secure and high-availability data storage.

Steps:

  1. Go to the RDS Dashboard.
  2. Click Create Database → Choose Amazon Aurora MySQL.
  3. Configure settings:
  4. Assign the Database Security Group created earlier.

Article content


Article content


Article content
📌

Step 4: Configuring the Application Tier

Why?

The application tier processes business logic and interacts with the database.

Steps:

  1. Launch EC2 Instances for application servers
  2. Install Node.js and deploy your API server.
  3. Configure an Internal Load Balancer (ALB):Internal Facing(non-internet)


Article content


Article content


Article content
📌

Step 5: Setting Up the Web Tier

Why?

The web tier hosts the front-end application and routes API requests.

Steps:

  1. Launch EC2 Instances for web servers:
  2. Install Nginx and deploy the React.js frontend.
  3. Configure Nginx to:
  4. Attach the web servers to an External ALB for load balancing.


Article content


Article content
📌

Step 6: Implementing Auto Scaling Groups

Why?

Auto Scaling ensures optimal performance by adjusting the number of instances based on traffic.

Steps:

  1. Configure Auto Scaling Groups for Web and Application Tiers.
  2. Define scaling policies.
  3. Attach instances to the appropriate Load Balancers.


Step 7: Configuring Route 53 for Domain Name

Why?

Amazon Route 53 provides a domain name system (DNS) to map domain names to resources.

Steps:

  1. Register a domain or use an existing one.
  2. Create an A record to point to the External ALB.
  3. Enable HTTPS using an SSL certificate from AWS Certificate Manager.

Step 8: Testing the Final Deployment

Once all components are set up, test the deployment:

  • Access the Web Application via the domain name.
  • Check API Requests – Verify if API calls reach the application tier.
  • Monitor the Database – Ensure data transactions occur correctly.
  • Review Logs & Metrics – Use CloudWatch for monitoring.

Article content
Application database testing

Final Thoughts

Successfully built a Three-Tier Web Architecture on AWS using EC2, RDS , ALB, and Auto Scaling within VPC This setup ensures high availability, scalability, and reliability for your web applications.

🚀 Keep Learning & Experimenting!



Dinesh Rajasekhar

Spring Boot Enthusiast | Backend Developer | Core Java & SQL | Chairperson, IEEE SB NBKRIST | Gen Ai Enthusiast | Passionate About Scalable Tech Solutions | Database Management Specialist | Building Innovative Solutions

1mo

Congratulations brother 🙌

Like
Reply

To view or add a comment, sign in

More articles by Jyothish Thuraka

Insights from the community

Others also viewed

Explore topics