DevOpsAWSCloud

AWS High Availability & Auto Scaling: ELB, ASG & Route 53

Build highly available AWS architectures with Elastic Load Balancing, Auto Scaling Groups, and Route 53. Design systems that survive failures automatically. SAA-C03 guide.

TT
Sarah Mitchell
6 min read
AWS High Availability & Auto Scaling: ELB, ASG & Route 53

A highly available system is one that keeps working even when individual components fail. In AWS, high availability is not an accident — it is a deliberate combination of load balancers distributing traffic, Auto Scaling Groups replacing failed instances, and Route 53 routing users to healthy endpoints.

This lesson covers the three pillars of AWS high availability architecture.


Elastic Load Balancing (ELB)

A load balancer distributes incoming traffic across multiple targets (EC2 instances, containers, Lambda functions, IP addresses) in one or more Availability Zones. If a target fails its health check, the load balancer stops sending it traffic.

Load BalancerOSI LayerProtocolBest For
Application Load Balancer (ALB)Layer 7HTTP/HTTPS/WebSocketWeb apps, microservices, content-based routing
Network Load Balancer (NLB)Layer 4TCP/UDP/TLSHigh performance, static IPs, non-HTTP workloads
Gateway Load Balancer (GWLB)Layer 3IPThird-party virtual appliances (firewalls, IDS)
Classic Load BalancerLayer 4/7HTTP/HTTPS/TCPLegacy (avoid for new workloads)

Application Load Balancer (ALB)

The ALB operates at Layer 7 — it understands HTTP. This enables content-based routing:

text
ALB: api.example.com

  Rule 1: /api/users/*    →  Target Group: users-service
  Rule 2: /api/orders/*   →  Target Group: orders-service
  Rule 3: /static/*       →  Target Group: s3-bucket (or EC2)
  Default:                →  Target Group: web-frontend

ALB routing rules can match on path (/api/*, /images/*), host header (api.example.com vs app.example.com), HTTP headers, query strings, and source IP.

Target Groups contain registered targets (instances, IPs, Lambda functions) and perform health checks. ALBs support sticky sessions (session affinity) — the same client is always routed to the same target using a cookie.

Network Load Balancer (NLB)

The NLB operates at Layer 4 — it forwards TCP/UDP packets without inspecting HTTP content. It handles millions of requests per second with ultra-low latency (~100μs), has a static IP address per AZ (useful for whitelisting), preserves the client's source IP address, and supports TLS termination.

Use the NLB for game servers, financial trading systems, IoT devices, or any TCP/UDP workload that ALB cannot handle.


Auto Scaling Groups (ASG)

An Auto Scaling Group maintains a fleet of EC2 instances. It automatically launches new instances when demand increases and terminates instances when demand drops — keeping you within the desired capacity range.

ASG Configuration

text
Auto Scaling Group: web-asg
  Launch Template: web-lt (AMI, instance type, security group, user data)
  Min capacity:     2   ← always at least 2 instances running
  Desired capacity: 4   ← current target
  Max capacity:    10   ← never exceed 10 instances
  VPC subnets: us-east-1a, us-east-1b, us-east-1c
  Attached to: ALB target group web-tg

The ASG distributes instances across the specified subnets — ensuring your fleet spans multiple AZs automatically.

Scaling Policies

Target Tracking: Maintain a specific metric at a target value — the simplest and most recommended approach. For example: keep average CPU at 50% and the ASG automatically adds/removes instances to maintain that target.

Step Scaling: Add/remove a specific number of instances based on how far a metric breaches an alarm threshold.

Scheduled Scaling: Scale at known times — for predictable traffic patterns. For example: every weekday at 08:00 set desired capacity to 10, every weekday at 20:00 set desired capacity to 2.

Predictive Scaling: Uses machine learning to forecast load based on historical patterns and scales proactively before demand arrives.

Scaling Cooldown

After a scaling activity, the ASG waits for a cooldown period (default: 300 seconds) before launching or terminating additional instances. This prevents thrashing — launching and immediately terminating instances if a metric fluctuates around the threshold.

Instance Refresh

Instance Refresh replaces all instances in the ASG rolling — useful for deploying a new AMI without downtime.

bash
aws autoscaling start-instance-refresh \
  --auto-scaling-group-name web-asg \
  --preferences MinHealthyPercentage=90

AWS Route 53

Route 53 is AWS's scalable, highly available DNS service. It translates domain names to IP addresses and routes users to healthy endpoints.

Record Types

RecordPurpose
ADomain → IPv4 address
AAAADomain → IPv6 address
CNAMEDomain → another domain
AliasAWS-specific — domain → AWS resource (ALB, CloudFront, S3 website)
MXMail server record
TXTText records, domain verification

Alias records resolve to an AWS resource and are free of charge for queries. Unlike CNAME, Alias records can be created at the zone apex (root domain, e.g., example.com).

Routing Policies

PolicyBehaviourUse Case
SimpleReturns one or more valuesSingle resource, no health checks
WeightedDistributes traffic by percentageA/B testing, blue/green deployments
Latency-basedRoutes to region with lowest latencyGlobal applications
FailoverActive-passive failover to secondaryDisaster recovery
GeolocationRoutes based on user's geographic locationContent localisation, compliance
Multi-Value AnswerReturns up to 8 healthy recordsSimple load balancing with health checks

Route 53 Health Checks

Route 53 health checks monitor the health of your endpoints and integrate with routing policies to remove unhealthy endpoints from DNS responses automatically.


High Availability Architecture Patterns

Multi-AZ Web Application (Classic Three-Tier)

text
Internet
    ↓
Route 53 (DNS + health checks)
    ↓
Application Load Balancer (multi-AZ)
    ↓
Auto Scaling Group — EC2 instances across 3 AZs
    ↓
RDS Multi-AZ (primary in 1a, standby in 1b)
+ ElastiCache Redis cluster

This architecture survives the failure of any single AZ — the ALB routes to instances in other AZs, the ASG launches replacement instances in healthy AZs, and RDS fails over to the standby automatically.

RTO and RPO

MetricDefinitionExample
RTO (Recovery Time Objective)Maximum acceptable downtimeMinutes (Multi-AZ) to hours (cross-region)
RPO (Recovery Point Objective)Maximum acceptable data lossSeconds (synchronous replication) to hours (daily backups)

Multi-AZ RDS: RTO ~2 minutes, RPO ~0 (synchronous replication, no data loss).


Previous: Lesson 7 — AWS Databases | Next: Lesson 9 — Solutions Architect Patterns


Part of the AWS Cloud Fundamentals course.

External references: