Cost optimization là một trong 6 pillars Well-Architected Framework.
Compute optimization:
- Chuyển On-Demand sang Reserved Instances/Savings Plans (tiết kiệm 30-60% cho baseline workload).
- Dùng Spot Instances cho batch/fault-tolerant workload (tiết kiệm đến 90%).
- Right-size instances (dùng Compute Optimizer để suggest instance type phù hợp).
- Tắt non-production environment ngoài giờ làm việc (Lambda + EventBridge scheduler).
Storage optimization:
- S3 Intelligent-Tiering cho data không rõ access pattern.
- Lifecycle policy chuyển sang IA/Glacier/Deep Archive.
- Enable S3 compression.
- Xóa unattached EBS volumes (thường quên tạo snapshot rồi delete instance).
- Xóa old EBS snapshots.
- Dùng gp3 thay gp2 (rẻ hơn 20% và IOPS cao hơn).
Data transfer optimization:
- Data transfer within region miễn phí.
- Cross-AZ $0.01/GB mỗi chiều (đặt DB và app cùng AZ cho non-HA workload).
- CloudFront giảm origin data transfer.
- VPC Endpoint loại bỏ NAT Gateway cost cho S3/DynamoDB access.
Database optimization: Aurora Serverless cho dev/test, DynamoDB on-demand cho sporadic traffic, ElastiCache giảm DB load và RDS cost.
Monitoring cost: AWS Cost Explorer phân tích spending trend, Budget Alerts khi vượt threshold, Cost Allocation Tags track by team/project, Trusted Advisor recommendations. Kiến trúc: serverless loại bỏ idle compute cost, managed services giảm operational labor cost.