High Availability (HA) Architecture

Benjamin
3 min readSep 12, 2021

--

Elastic Load Balancers

  • Application Load Balancers: For intelligent routing
  • Network Load Balancers: For very high performance and a fixed IP address
  • Classic Load Balancers: Where you want to keep your costs down
  • 504 Error means the gateway has timed out. This means that the application is not responding within the idle timeout period
  • Troubleshoot the application. Is it the Web Server or Database Server? Scale up or down where necessary
  • If you need the IPv4 address of your end user, look for the X-Forwarded-For header

Load Balancers and Health Checks

  • Instances monitored by ELB are reported as: InService, or OutofService
  • Health checks check the instance health by talking to it
  • Load balancers have their own DNS name. You are never given an IP address

Advanced Load Balancer Theory

  • Sticky sessions enable your users to stick to the same EC2 instance. Can be useful if you are storing information locally to that instance
  • Cross Zone Load balancing enables you to load balance across multiple AZs
  • Path patterns allow you to direct traffic to different EC2 instances based on the URL contained in the request

Auto Scaling

Scaling options:

  • maintain current instance levels at all times
  • Scale manually
  • Scale based on a schedule
  • Scale based on demand (popular)
  • Use predictive scaling

HA Architecture

  • Always design for failure
  • Use multiple AZs and multiple regions where you can
  • Multi-AZ (for Distaster Recovery (DR)) and Read Replicas (for Performance) for RDS
  • Scaling up (increasing resources inside EC2 instances) vs Scaling out (using Auto Scaling Groups to add additional instances)
  • Always consider cost element
  • S3 storage classes

CloudFormation

  • A way of completely scripting your cloud environment
  • Quick Start is a bunch of Cloudformation templates already builot by AWS Solutions Architects allowing you to create complex environments
  • https://aws.amazon.com/quickstart/

Elastic Beanstalk

  • With Elastic Beanstalk, you can quickly deploy and manage applications in the AWS Cloud without worrying about the infrastructure that runs the applications. You simply upload your application, and Elastic Beanstalk automatically handles the details of capacity provisioning, loas balancing, scaling, and application monitoring

High Availability with Bastion Hosts

  • Two hosts in two separate AZs. Use a NLB with static IP addresses and health checks to fail over from one host to the other
  • Can’t use an ALB as it is Layer 7 and you need to use Layer 4
  • One host in one AZ behind an Auto Scaling group with health checks and a fixed EIP. If the host fails, the health check will fail and the Auto Scaling group will provision a new EC2 instance in a separate AZ. You can use a user data script to provision the same EIP to the new host. This is the cheapest option, but it is not 100% fault tolerant

On-Premises Services with AWS

  • Database Migration Service (DMS)
  • Server Migration Service (SMS)
  • AWS Application Discovery Service
  • VM Import/Export
  • Download Amazon Linux 2 as an ISO

--

--

Benjamin
Benjamin

Written by Benjamin

... practising Software Engineering and DevOps.

No responses yet