AWS CLF-C02 — Domain 3: Cloud Technology & Services
Scalability means an application can handle greater loads by adapting. There are two types:
| Type | Description | Example |
|---|---|---|
| Vertical Scaling (Scale Up/Down) | Increase the size of the instance (more CPU, RAM). Has a hardware limit. | Upgrade from t2.micro to t2.large. Common for non-distributed systems like databases (RDS, ElastiCache). |
| Horizontal Scaling (Scale Out/In) | Increase the number of instances. No hardware limit. | Add more EC2 instances behind a load balancer. Implies a distributed system. |
Elasticity = the ability to auto-scale based on demand (scale out when load increases, scale in when load decreases). This is a key cloud advantage over traditional infrastructure.
| Type | Layer | Protocol | Key Features | Use Cases |
|---|---|---|---|---|
| Application Load Balancer (ALB) | Layer 7 (Application) | HTTP, HTTPS, WebSocket | Path-based & host-based routing, fixed hostname, can see client IP (X-Forwarded-For), targets: EC2, ECS, Lambda, IP addresses | Web applications, microservices, container-based apps |
| Network Load Balancer (NLB) | Layer 4 (Transport) | TCP, UDP, TLS | Ultra-low latency (~100ms vs 400ms for ALB), handles millions of requests/sec, static IP / Elastic IP per AZ, targets: EC2, IP addresses, ALB | Extreme performance, gaming, IoT, real-time streaming |
| Gateway Load Balancer (GWLB) | Layer 3 (Network) | IP Protocol (GENEVE on port 6081) | Deploy, scale, and manage 3rd-party network virtual appliances. Single entry/exit for all traffic. Transparent to applications. | Firewalls, intrusion detection/prevention systems (IDS/IPS), deep packet inspection, payload manipulation |
"HTTP/HTTPS traffic routing?" → ALB. "Ultra-low latency, TCP/UDP, static IP?" → NLB. "Network appliances (firewall, IDS)?" → GWLB. The old Classic Load Balancer (CLB) is deprecated — don't pick it on the exam.
/health)Health checks are critical for ensuring high availability. An unhealthy instance is automatically removed from the load balancer's target pool. No manual intervention needed.
"How to manage SSL certificates for your load balancer?" → AWS Certificate Manager (ACM). "How to host multiple HTTPS sites on one ALB?" → SNI (Server Name Indication).
| Setting | Description |
|---|---|
| Launch Template | Defines instance configuration: AMI, instance type, key pair, security groups, user data, IAM role, EBS volumes |
| Minimum Capacity | Minimum number of instances that must always be running |
| Desired Capacity | Number of instances you want running (ASG tries to maintain this) |
| Maximum Capacity | Maximum number of instances the ASG can scale to |
ASG uses a Launch Template (recommended) or Launch Configuration (legacy) to know what kind of EC2 instances to launch. The ASG respects min/desired/max capacity settings.
| Policy Type | Description | Example |
|---|---|---|
| Target Tracking Scaling | Set a target metric value and ASG adjusts to maintain it. Simplest to set up. | "Keep average CPU utilization at 40%" |
| Simple / Step Scaling | Add/remove instances based on CloudWatch alarm thresholds. Step scaling allows different actions at different thresholds. | "When CPU > 70%, add 2 instances. When CPU < 30%, remove 1 instance." |
| Scheduled Scaling | Scale based on known usage patterns at specific times. | "Increase min capacity to 10 at 5 PM on Fridays" (for a known traffic spike) |
| Predictive Scaling | Uses machine learning to predict future traffic and schedule scaling ahead of time. | AWS analyzes historical patterns and pre-provisions instances before demand arrives. |
"Easiest way to maintain CPU at a target value?" → Target Tracking Scaling. "Scale based on known schedule?" → Scheduled Scaling. "ML-based scaling before demand?" → Predictive Scaling. Remember: ASG + ELB = scalable & highly available architecture.
A well-architected, scalable, and highly available setup typically includes:
ELB + ASG is the foundational architecture pattern for scalable, fault-tolerant applications on AWS. The load balancer handles traffic distribution, and the ASG handles capacity management.