Design Cost-Optimized Architectures
Core concepts
Cost questions test whether you can identify the shape of the workload and the hidden line items.
Purchasing: On-Demand for spiky or short-lived work, Savings Plans and Reserved Instances for steady-state baselines (Compute Savings Plans are the most flexible across families and regions), Spot for fault-tolerant batch and stateless workers with checkpointing. A mixed answer is usually correct: cover the 24/7 baseline with a commitment, run the burst on On-Demand or Spot.
Storage lifecycle: S3 Standard to Standard-IA to Glacier Instant Retrieval, Flexible Retrieval, Deep Archive, driven by access pattern and retrieval tolerance; Intelligent-Tiering when patterns are unknown. Lifecycle rules expire noncurrent versions and incomplete multipart uploads. gp2 volumes can move to gp3 for roughly 20% savings at equal-or-better baseline performance, and unattached EBS volumes and idle Elastic IPs are pure waste.
Data transfer and network: the cheapest byte is the one that never crosses a boundary. Cross-AZ traffic is billed in both directions, NAT Gateway charges per GB processed plus hourly, and cross-region transfer is expensive. CloudFront and VPC gateway endpoints for S3/DynamoDB often cut NAT costs substantially. Keep chatty tiers in one AZ when resilience allows.
Visibility: Cost Explorer, Budgets with alerts, Cost Allocation Tags, and Trusted Advisor checks are the governance tools; Compute Optimizer and S3 Storage Lens suggest right-sizing.
Traps
- Reserved capacity for a workload that runs four hours a week.
- Spot for stateful, non-interruptible workloads.
- Forgetting NAT Gateway data processing charges when sizing a VPC design.
Worked example
A steady 24/7 web tier with unpredictable nightly batch: buy Compute Savings Plans for the always-on baseline, run the batch on Spot with checkpointing, and put static assets behind CloudFront to reduce both egress and origin load.