How to design 2 – tier architecture for Web application with High Availability

How to design 2 – tier architecture for Web application with High Availability

May 30, 2020 / Nirav Shah

Overview of AWS single tier, two-tier, and three-tier architecture

In this blog we will explain to you about two-tier and three-tier architecture, and how we can design two-tier architecture with high Availability on AWS infrastructure.

So let get started with single tier architecture and then go to other type of the architecture,

Single tier architecture

Generally single tier architecture is used for small applications in which there is one server (both the backend and the frontend). and Single-tier deployment is cost-effective.

But having all the resources on the same machine can create an availability and security risk. If the server is down, the application will be down, and it will not communicate with the database. If the server is externally attacked, you are at greater risk of data loss if you do not have a replica of your database.

The typical architecture of diagram of Single-Tier Solution looks like this:

Two-tier architecture

architecture of diagram of Single-Tier Solution

Three-tier architecture

Now let’s try to understand about two-tier architecture and its advantages

The two-tier architecture is like client server application. The direct communication takes place between client and server. There is no intermediate between client and server. Because of tight coupling a 2 tiered application will run faster.

The Two-tier architecture is divided into two parts:

  1. Client Application (Client Tier)
  2. Database (Data Tier)

AWS 3 tier architecture diagram

Two-tier architecture two parts

On the client application side the code is written for saving the data in the SQL server database. Client sends the request to the server and it processes the request & sends it back with data. The main problem of two tier architecture is the server cannot respond to multiple requests at the same time, as a result it causes a data integrity issue.

It’s also called server-client technology.

Advantages:

  1. Easy to maintain and modification is bit easy
  2. Communication is faster

Disadvantages:

  1. In two tier architecture application performance will be degraded as soon as the number of users increases.
  2. Cost-ineffective

So now let understand in AWS cloud terminology,

Here simple explain of two-tier architecture web application deployment on AWS infrastructure,

AWS 2 tier architecture diagram

Above diagram you can see so many AWS services are used, like,

  1. VPC
  2. Route53
  3. RDS
  4. S3
  5. ELB
  6. EC2
  7. Cloudfront

Here you can see that a custom VPC is created so that your Web application will be secure, we have spread all resources across two availability zones (AZ) to provide for redundancy for scheduled system maintenance. As such, each availability zone is hosting at least one instance per service, except for services that are redundant by design (e.g. Simple Storage Service, Elastic Load Balancer, Route 53, etc.).

Web Tier consists of two web servers (one in each availability zone) that are deployed on Elastic Compute Cloud (EC2) instances. We balance external traffic to the servers using Elastic Load Balancers (ELB). Dynamic scaling policies allow you to elastically scale the environment in adding or removing web instances to the auto scaling group. Amazon Cloud Watch allows us to monitor demand in our environment and triggers scaling events using Cloud Watch alarms.

Database Tier, Relational Database Service (RDS) provides the relational (MySQL, MS SQL or Oracle) environment for this solution. In this design, it is established as a multi-AZ deployment. The multi-AZ deployment includes a standby RDS instance in the second availability zone, which provides us with increased availability and durability for the database service in synchronously replicating all data to the standby instance.

Optionally we can also provision read replicas to reduce the demand on the master database. To optimize costs, our initial deployment may only include the master and slave RDS instances, with additional read replicas created in each AZ as dictated by the demand.

For minimized latency we use Amazon’s CloudFront content distribution network. CloudFront maintains many edge locations across the globe. An edge location acts as a massive cache for web and streaming content.

We use the Route 53 domain name service for the registration and management of our Internet domain.

So this is about two-tier architecture Now see the below diagram of three-tier architecture on AWS infrastructure

AWS 3 tier architecture diagram

When you design the solution for web- application you have to keep in mind the below points.

  1. Availability
  2. Security
  3. Performance
  4. Reliability
  5. Cost Optimization

Summary

In this blog we learned about single tier, two tier and three tier architecture. So in single tier we have only one server and one database and in two tier architecture on

Talk to AWS Certified Consultant

    Spread Love By Sharing:

    Let’s Talk About Your Needed AWS Infrastructure Management Services

    Have queries about your project idea or concept? Please drop in your project details to discuss with our AWS Global Cloud Infrastructure service specialists and consultants.

    • Swift Hiring and Onboarding
    • Experienced and Trained AWS Team
    • Quality Consulting and Programming
    Let’s Connect and Discuss Your Project