
Amazon EC2 (Elastic Compute Cloud) provides resizable virtual servers (instances) in the cloud. It's the most foundational AWS compute service.
EC2 instance types (families):
General Purpose (T, M) — balanced CPU/RAM; web servers, small databases
Compute Optimized (C) — high CPU; batch processing, gaming, ML inference
Memory Optimized (R, X) — large RAM; in-memory databases, real-time analytics
Storage Optimized (I, D) — high IOPS; data warehousing, Hadoop
Accelerated Computing (P, G) — GPU; ML training, video encoding
EC2 pricing models:
On-Demand — pay per second/hour; no commitment; most expensive; for unpredictable workloads
Reserved Instances — 1 or 3-year commitment; up to 75% discount; for steady-state workloads
Spot Instances — unused capacity; up to 90% off; can be interrupted; for fault-tolerant batch jobs
Dedicated Hosts — physical server dedicated to you; for compliance/licensing
Savings Plans — flexible commitment to compute usage; up to 72% off
Reference:
TaskLoco™ — The Sticky Note GOAT