Mastering AWS ELB & ASG

Vertical vs horizontal scaling, 3 ELB types, and ASG strategies — master high availability and elasticity concepts essential for the CLF-C02 exam.

AWS ELB & ASG — High Availability and Scalability

One of the most common challenges in cloud infrastructure design is handling traffic fluctuations reliably. AWS addresses this with Elastic Load Balancer (ELB) and Auto Scaling Group (ASG). Combining these two services allows you to achieve both high availability and automatic scalability. The CLF-C02 exam frequently tests knowledge of their types and how they work.

---

Scalability, Elasticity, and High Availability

These three terms are closely related but have distinct meanings. On the exam, you need to be able to distinguish each definition.

| Term | Definition | Key Characteristic | |------|------------|-------------------| | Scalability | Ability to increase or decrease system capacity as load changes | Adjust capacity when needed | | Elasticity | Ability to automatically adjust resources based on real-time load | Automated scalability | | Agility | Ability to quickly deploy and manage resources as demands change | Fast resource provisioning |

Elasticity is the automated form of scalability. ASG is the prime example of elasticity in AWS — it automatically adjusts the number of instances in response to changing traffic.

---

Vertical vs Horizontal Scaling

There are two main approaches to scaling. Understanding which approach suits which situation is essential.

Vertical Scaling — Scale Up/Down

This approach increases the size of a single instance. For example, upgrading from to . It is commonly used for services that are difficult to distribute, such as databases, but hardware limits mean it cannot scale infinitely.

Horizontal Scaling — Scale Out/In

This approach increases the number of instances — for example, going from 1 server to 10. It is implemented using Auto Scaling Group (ASG) combined with Elastic Load Balancer (ELB). This approach suits distributed systems and is theoretically unlimited in scale.

High Availability

High availability is an architectural principle that deploys instances across multiple Availability Zones (Multi-AZ) so that a failure in one zone does not interrupt service. It is typically applied alongside horizontal scaling.

Key distinctions to remember for the exam:

Vertical scaling = Scale Up/Down (change instance size) Horizontal scaling = Scale Out/In (change number of instances) High Availability = Multi-AZ deployment

---

What Is a Load Balancer?

A load balancer distributes incoming traffic across multiple EC2 instances to prevent any single server from being overwhelmed.

The main benefits of using a load balancer include:

Prevents single server overload Automatically reroutes traffic away from failed instances Performs automatic health checks on instances Handles SSL termination (HTTPS)

AWS Elastic Load Balancer (ELB) is a fully managed load balancing service. AWS handles upgrades, maintenance, and availability on your behalf, so you do not need to operate a dedicated load balancer server.

---

Three Types of ELB

ELB comes in three types. It is important to distinguish each type by its OSI layer, protocol, and appropriate use case.

| Type | Layer | Protocol | Key Characteristics | |------|-------|----------|-------------------| | ALB (Application Load Balancer) | Layer 7 (Application) | HTTP, HTTPS | URL path/host-based routing, suited for microservices | | NLB (Network Load Balancer) | Layer 4 (Transport) | TCP, UDP | Ultra-high performance, low latency, millions of requests per second | | CLB (Classic Load Balancer) | Layer 4/7 | HTTP, HTTPS, TCP | Legacy — not recommended for new workloads |

Selection guidelines:

Use ALB (Layer 7) for HTTP/HTTPS traffic. Use NLB (Layer 4) for high-performance TCP/UDP traffic. CLB is being phased out and is not recommended for new workloads.

---

What Is an Auto Scaling Group (ASG)?

An ASG automatically adjusts the number of EC2 instances based on load. It integrates with ELB to automatically register new instances to the load balancer, and automatically replaces unhealthy instances when health checks fail.

Core ASG capabilities:

| Feature | Description | |---------|-------------| | Scale Out | Add instances when load increases | | Scale In | Remove instances when load decreases | | Min/Max Limits | Always maintain a defined instance count range | | Auto-register with ELB | New instances automatically join the load balancer | | Replace unhealthy instances | Automatically terminates and replaces failed instances | | Cost optimization | Run only what you need — avoid over-provisioning |

Four ASG Scaling Strategies

Manual Scaling

The administrator manually sets the desired number of instances. Used when traffic patterns are not clearly predictable or when a temporary adjustment is needed.

Dynamic Scaling

Responds automatically to CloudWatch alarms. Simple/Step Scaling adds 2 instances when CPU exceeds 70% and removes 1 when it falls below 30%. Target Tracking Scaling automatically adjusts the instance count to maintain an average CPU of around 40%.

Scheduled Scaling

Pre-schedules scaling actions based on predictable traffic patterns. For example, you can configure the minimum instance count to increase to 10 every Friday at 5 PM.

Predictive Scaling

Uses machine learning (ML) to analyze historical traffic patterns and forecast future demand, scaling proactively before demand arrives. When the exam describes "ML-based proactive scaling," it is referring to Predictive Scaling.

---

Using ELB and ASG Together

Combining ELB and ASG creates a fully automated, highly available architecture. When traffic increases, ASG adds instances and ELB automatically registers them to distribute the load. When an instance fails, ELB routes traffic to healthy instances while ASG replaces the failed instance with a new one.

This combination is a foundational pattern in AWS cloud architecture and represents the standard design for achieving both cost efficiency and reliability.

Back to blog list