Achieving High Availability on AWS Cloud with EC2 and RDS

Achieving High Availability on AWS Cloud with EC2 and RDS

Wondering how i achieved high availability for applications running on EC2. Let’s dive in.

Task?—?Being a Solution Architect and Part of the Cloud Center of Excellence team I have been reached by the Application team to review the existing architecture and make the Application high available by eliminating Single Point of Failure.

Existing Architecture.

Challenges with Existing Architecture

Single Point of Failure?:App was running on a Single server with a single database instance on a Single Availability Zone. When the server used to go down no users were able to access the site and when the database instance crashed the entire app used to become unusable.

Impact?:Complete Service disruption, revenue loss, poor user experience.

Highly Available Architecture

How did I make the App High Available?

First let’s try to understand what high availability means.

What is High Availability?

High availability describes System continues functioning even when some of the components fail. It is achieved by having redundant components in the system design and becoz of this redundancy system guarantees a certain percentage of uptime.

To make a System high available we need to identify the single point of failure. In a traditional 3 tier architecture some of the single point of failure could be

1.Server running the applications.

2.Load Balancer

3.Database.

How did I do it? Let’s go over it.

Making an app highly available on AWS using EC2 and RDS involves designing for fault tolerance, scalability, and resilience. Here’s a step-by-step approach which i took.

1. Used Multiple Availability Zones?(AZs)

  • AWS Availability Zones (AZs) are isolated data centers within a region.
  • Deployed EC2 instances in at least two AZs to ensure redundancy.
  • Used an Auto Scaling Group (ASG) to automatically launch instances in different AZs based on traffic.
  • Benefits: If one AZ went down, the application remains available.

Implementation Steps:

  1. Launched an EC2 instances in multiple AZs using an ASG.
  2. Set the desired capacity and minimum number of instances in the ASG.
  3. Defined a launch template to standardize EC2 instance configuration.
  4. Attached the ASG to an Elastic Load Balancer (ALB).

2. Set Up an Elastic Load Balancer?(ELB)

A Load Balancer ensures traffic is evenly distributed across multiple EC2 instances.

Implementation Steps:

  1. Created an ALB in AWS.
  2. Added two or more EC2 instances in different AZs as targets.
  3. Configured health checks to remove unhealthy instances.

3. Enable Auto?Scaling

Auto Scaling dynamically adjusts the number of EC2 instances based on demand.

Implementation Steps:

  1. Defined an Auto Scaling Group (ASG) with a launch template.
  2. Configure scaling policies:

  • Scale-out when CPU usage > 60%.
  • Scale-in when CPU usage < 30%.

3. Attached ASG to the ALB for automatic traffic routing.

Benefit: Even during traffic spikes or instance failures the app remained available.

4. Configure RDS for High Availability

A highly available database setup prevents downtime if one database instance fails.

Key AWS RDS Features:

  • Multi-AZ Deployment: Automatic failover to a standby database in a different AZ.
  • Read Replicas: Distributes read traffic across multiple instances to reduce the load.
  • Automated Backups: Allows point-in-time recovery.

Implementation Steps:

  1. Create an RDS instance with Multi-AZ enabled.
  2. Enable automated backups and set a retention period.
  3. For read-heavy workloads, created Read Replicas and direct read queries to them.
  4. Used RDS Proxy to improve connection pooling.

In Conclusion.

Leveraging the above Service in AWS and making use of the AWS Well Architected framework (Reliability Pillar) i was able to design and implement the solution of making an app highly available by elimination single point of failure.

High Availability (HA) is not optional for modern applications. Without it, you risk downtime, poor performance, and security threats. Implementing AWS HA solutions ensures scalability, resilience, and reliability for mission-critical workloads.

Have you ever been asked to make an app highly available? How did you do it? Would love to know your experience.



Madhuri Sharma

DevOps Lead @Telus Digital || 10K @LinkedIn || AWS || K8s || CICD || Terraform || DevOps || Service Mesh-Istio || Prometheus && Grafanna

1 个月

Insightful Ajay Pandey

Pankaj Sinha

DWP Workplace | Exchange | M365 | Azure AD | Consultant

1 个月

Very well Explained.

要查看或添加评论,请登录

Ajay Pandey的更多文章

社区洞察

其他会员也浏览了