Overview
Amazon Elastic Compute Cloud (EC2) provides various purchasing options to help you optimize costs while meeting performance requirements. Understanding when to use which model is a core competency for the SAA-C03 exam, specifically under the Cost Optimization pillar of the Well-Architected Framework.
The “Housing Market” Analogy
To understand EC2 pricing, think of living arrangements:
- On-Demand: Like a Hotel. You show up, pay the nightly rate, and leave whenever you want. High flexibility, high cost.
- Reserved Instances/Savings Plans: Like a Lease. You sign a contract for 1 or 3 years. You pay less per month because you committed to the time.
- Spot Instances: Like a Shared Hostel Bed with a “Kick-out” clause. It’s extremely cheap, but if a full-paying guest arrives, you might be asked to leave with a 2-minute notice.
Core Concepts & Well-Architected Framework
AWS recommends matching the pricing model to the workload’s availability and predictability requirements:
- Cost Optimization: Use Spot instances for stateless, fault-tolerant workloads to save up to 90%.
- Reliability: Use On-Demand or Reserved Instances for mission-critical production databases that cannot afford interruptions.
Comparison of Pricing Models
| Model | Commitment | Discount | Best For… |
|---|---|---|---|
| On-Demand | None (Per second) | 0% (Baseline) | New workloads, short-term, unpredictable spikes. |
| Reserved Instances (RI) | 1 or 3 Years | Up to 72% | Steady-state usage, specific instance types. |
| Savings Plans | 1 or 3 Years | Up to 72% | Flexible usage across instance families and regions. |
| Spot Instances | None (Can be reclaimed) | Up to 90% | Batch jobs, CI/CD, data analysis, fault-tolerant apps. |
| Dedicated Hosts | Varies | Low | Compliance, BYOL (Bring Your Own License) scenarios. |
Scenario-Based Decision Matrix
If the requirement is… then use…
- …a steady-state database running 24/7: Reserved Instances or Compute Savings Plans.
- …processing a large dataset that can be paused/restarted: Spot Instances.
- …a brand new application with unknown traffic patterns: On-Demand.
- …strict regulatory requirements for physical isolation: Dedicated Hosts.
Exam Tips: Golden Nuggets
- Spot Reclaim: AWS gives a 2-minute warning before reclaiming a Spot instance. Use EC2 Instance Metadata Service to monitor for this.
- Convertible RIs: Choose these if you need to change instance families (e.g., move from C5 to M5) during the term.
- Savings Plans: Unlike RIs, Compute Savings Plans apply automatically to EC2, Fargate, and Lambda.
- Default Choice: If the exam mentions “Cost-Effective” and “Fault-Tolerant” in the same sentence, the answer is almost always Spot Instances.
Architectural Flow: Choosing EC2 Pricing
Key Services
EC2 Fleet: Automates the mix of On-Demand and Spot instances to maintain capacity at the lowest price.
AWS Cost Explorer: Used to visualize usage patterns and receive RI/Savings Plan recommendations.
Common Pitfalls
Under-utilization: Buying a 3-year RI for an instance you only use 4 hours a day. (Use On-Demand instead!)
Spot Interruption: Forgetting to handle the 2-minute termination signal, leading to data loss in memory.
Quick Patterns
The “Hybrid” Strategy: Use Reserved Instances for the “baseline” load and On-Demand (Auto Scaling) for the “peaks”.
The “Batch” Strategy: Use Spot Instances for large-scale data processing that can restart from a checkpoint.