DEV Community

Bharath.K.A
Bharath.K.A

Posted on

Intro to 3 tier architecture

Image description
In today's cloud-native world, a robust and scalable application architecture is crucial for success. One such architecture that has proven its worth is the three-tier architecture. This model divides an application into three distinct layers, each with its own set of responsibilities.

Let's explore a visual representation of a three-tier architecture deployed on Amazon Web Services (AWS).

The Three Tiers

Web Tier: This is the front-facing layer that interacts directly with users. It handles incoming requests, processes them, and forwards them to the appropriate backend services. In our diagram, this tier comprises Amazon EC2 instances in a public subnet. These instances are responsible for serving static content, handling user authentication, and routing requests to the application tier.

Application Tier: This layer is the heart of the application, where business logic and data processing occur. It receives requests from the web tier, performs necessary actions, and interacts with the database tier to retrieve or store data. In our diagram, this tier also consists of Amazon EC2 instances, but they reside in a private subnet for enhanced security.

Database Tier: This layer is responsible for storing and managing the application's data. It provides a reliable and scalable platform for data persistence and retrieval. In our diagram, we see Amazon Aurora, a fully managed relational database service, handling both the primary database and a read replica for improved performance and availability.

Key Components

VPC: A virtual private cloud provides a logically isolated section of the AWS cloud where you can launch AWS resources in a virtual network that you1 define.  

Subnet: A subnet is a division of your VPC, similar to an IP address range on your home or office network. Subnets can be public or private, with public subnets having access to the internet and private subnets not.

Amazon EC2: This is a web service that provides resizable compute capacity in the cloud. You can launch as many or as few virtual servers as you need, and you can control them using the AWS Management Console or the AWS Command Line Interface (AWS CLI).

Elastic Load Balancing (ELB): ELB distributes incoming traffic across multiple targets, such as EC2 instances, containers, and IP addresses. This helps improve application availability, scalability, and fault tolerance.

MySQL: A popular open-source relational database management system.

Benefits:

Scalability: Each tier can be scaled independently to meet changing demands.

Maintainability: The separation of concerns makes it easier to develop, test, and maintain individual components.

Security: By placing sensitive components in private subnets, you can enhance security.

Availability: Redundancy mechanisms like ELB and read replicas can improve availability.

Implementation:

There are several steps:

Part 0 :
1-->Create a s3 Bucket

Image description

2-->Create a IAM role
Grant AmazonS3ReadOnlyAccess,AmazonSSMManagedInstanceCore to the IAM role

Image description

3--> Create a VPC(Virtual Private Cloud):

Image description

Give the VPC a name
CIDR=10.0.0.0/16

Image description

Create a Subnet

Top comments (0)