π‘οΈ High Availability (HA)
Runs across multiple Availability Zones π
Keeps working through failures β an AZ outage, an instance crash
π Scalability
πΌ Vertical scaling
Make each instance bigger
Example:
t2.micro β t2.large
β Horizontal scaling
Add more instances
Works well with distributed systems
β‘ Elasticity
Scales up or down automatically based on demand ππ
You only pay for what you're using π°
π Agility
Spin resources up or down in minutes
Speeds up development and deployment
Elastic Load Balancer (ELB)
What it does: Spreads traffic across your EC2 instances
Key features:
βοΈ Distributes load
π Gives you a single DNS entry point
π‘οΈ Health-checks instances and only routes to healthy ones
π Works across multiple AZs for high availability
Types of load balancers:
Type | Layer | Use case |
|---|---|---|
π¦ ALB | Layer 7 | HTTP/HTTPS, web apps π |
π₯ NLB | Layer 4 | High performance, TCP/UDP β‘ |
π© GWLB | Layer 3 | Security, firewalls π |
β¬ CLB | Deprecated | Not on the exam β |
Auto Scaling Groups (ASG)
What it does: Manages your EC2 instances automatically
Key features:
β Scales out (adds instances)
β Scales in (removes instances)
π‘οΈ Replaces unhealthy instances
π― Keeps capacity at the desired level
Core settings:
Min = minimum instances allowed
Desired = target instance count
Max = upper limitELB + ASG: A Powerful Combo
Architecture:
Users π
β
Load Balancer βοΈ
β
Auto Scaling Group βοΈ
β
EC2 Instances (dynamic) π»What happens:
Traffic rises π β ASG adds instances β
Traffic drops π β ASG removes instances β
ELB spreads traffic across whatever's running βοΈ
An unhealthy instance β gets swapped out automatically π‘οΈ
Scaling Strategies
Strategy | Description |
|---|---|
ποΈ Manual | You set capacity yourself |
π¨ Step/Simple | Triggered by alarms |
π‘οΈ Target Tracking | Holds a metric steady (e.g., CPU at 40%) |
π Scheduled | Triggered by time |
π€ Predictive | Forecasts demand with ML |
Quick Recall
π HA β multi-AZ
πΌ Vertical β bigger machine
β Horizontal β more machines
β‘ Elasticity β automatic scaling
π Agility β fast provisioning
βοΈ ELB β traffic distribution
βοΈ ASG β instance management
Takeaway
Together, ELB + ASG give you:
π High availability
π Scalability
β‘ Elasticity
π Agility
Real-world flow:
User traffic π
β
ELB distributes βοΈ
β
ASG scales instances βοΈ
β
App stays fast, reliable, and cost-efficient β