categories.cloud-architecture Intermediate
How do you optimize cloud infrastructure costs? What are common cost reduction strategies?
Core Principles of Cloud Cost Optimization
Right-sizing: Choose instance types that best match your workload — avoid over-provisioning.
Eliminate waste: Find and delete unused resources (orphaned EBS volumes, unused Elastic IPs, old snapshots).
Purchase strategy optimization: Choose the right payment model based on workload stability.
Payment Model Comparison
| Model | Discount | Best For |
|---|---|---|
| On-Demand | No discount | Short-term, unpredictable workloads |
| Reserved Instances (1-3 yr) | Up to 72% | Stable production baseline load |
| Savings Plans | Up to 66% | Flexible compute commitment |
| Spot Instances | Up to 90% | Fault-tolerant batch jobs, CI/CD tasks |
Common Optimization Strategies
Compute layer
- Use Spot Instances for non-critical tasks (Spark jobs, CI runners)
- Buy Reserved Instances for production baseline capacity, use On-Demand for peaks
- Automatically shut down dev/test environments outside business hours
Storage layer
- Use S3 lifecycle policies: move to IA after 30 days, Glacier after 90 days
- Delete unattached EBS volumes and expired snapshots
Network layer
- Data Transfer Out costs are often a hidden expense
- Keep inter-service communication within the same Region/AZ when possible
- Use VPC Endpoints to avoid NAT Gateway charges
FinOps Practice
Build cost visibility: tag all resources with cost-center and team labels, track cloud spend by team, and set cost alerts.
✦ AI Mock Interview
Type your answer and get instant AI feedback
Sign in to use AI scoring
