S3 Storage Classes and Lifecycle: Cost Optimization
Fast recall
Quick revision
Core answer
Practical FinOps knowledge; understanding S3 cost drivers beyond just storage-per-GB
Leaving all objects on Standard forever, or picking One Zone-IA for critical data (no AZ redundancy)
Discuss Intelligent-Tiering for variable workloads, retrieval costs of Glacier, S3 Storage Lens for analysis, and request costs (PUT/GET) as separate cost driver
Interview-ready guide
Interview answer
S3 storage cost is one of the most commonly wasted spends on AWS. The default S3 Standard is great for hot data but costs 5 to 60 times more per GB than archival classes. A 100TB bucket on Standard costs $2,300 per month; on Glacier Deep Archive it's $40 per month.
The seven storage classes, ordered by cost
- S3 Standard at $0.023/GB — default, multi-AZ, for frequently accessed data
- S3 Intelligent-Tiering at $0.023/GB plus monitoring — AWS moves objects between tiers automatically; use when access patterns are unknown; no retrieval fees
- S3 Standard-IA at $0.0125/GB — infrequent access, immediate availability, multi-AZ, 30-day minimum
- S3 One Zone-IA at $0.01/GB — same as IA but single AZ, 20% cheaper, only for recreatable data
- S3 Glacier Instant Retrieval at $0.004/GB — archive with millisecond retrieval; quarterly access patterns
- S3 Glacier Flexible Retrieval at $0.0036/GB — minutes to hours retrieval
- S3 Glacier Deep Archive at $0.00099/GB — 12-hour retrieval; long-term compliance
Lifecycle rules are the mechanism
- Set rules like "transition to IA after 30 days, Glacier after 90, expire after 7 years"
- Configured once via bucket policy; AWS handles transitions automatically
- Critical: always add AbortIncompleteMultipartUpload (7 days) — failed multipart uploads leave invisible parts that accumulate and bill
The hidden cost drivers most teams miss
- Retrieval costs matter — IA charges $0.01/GB retrieval; if you access data frequently, retrieval cost can exceed storage savings
- Minimum storage duration — IA has 30-day minimum; Glacier has 90-180 day minimum; deleting early still charges for the minimum
- Minimum object size — 128KB for IA and Glacier Instant; tiny objects cost more per byte
- Request costs are separate — PUT at $0.005/1000, GET at $0.0004/1000; write-heavy workloads with millions of small objects may cost more in requests than storage
The decision rules
- Frequently accessed (daily): Standard
- Unknown access patterns, mixed: Intelligent-Tiering
- Known infrequent access, need immediate: Standard-IA
- Recreatable data okay with single AZ: One Zone-IA
- Quarterly access compliance data: Glacier Instant Retrieval
- Long-term compliance, slow retrieval OK: Deep Archive
The tools
- S3 Storage Lens is free and essential; shows bucket-level cost breakdown, object age distribution, IA-eligibility
- Enable the default dashboard (free) to understand your patterns before designing lifecycle rules
- S3 Intelligent-Tiering when in doubt — pays for itself vs manual tiering mistakes
The strategic answer
- Don't leave everything on Standard; set lifecycle rules from day one
- Use Intelligent-Tiering for variable or unknown workloads
- Analyze via Storage Lens monthly; adjust rules as patterns change
- Versioning plus lifecycle needs noncurrent-version rules too, or old versions pile up
S3 Storage Classes and Lifecycle: Cost Optimization
Direct Answer
Match storage class to access pattern: Standard for frequently accessed (default); Standard-IA / One Zone-IA for infrequent access (30+ day lifetime); Intelligent-Tiering when access patterns are unknown — AWS moves objects automatically; Glacier Instant for quarterly access; Glacier Flexible / Deep Archive for compliance archives. Set lifecycle rules from day one to transition old objects automatically. For a 100TB bucket, correct tiering cuts cost from ~$2,300/mo to ~$400/mo (IA) or ~$40/mo (Glacier).
Common Mistakes & Pitfalls
Leaving all objects on Standard forever, or picking One Zone-IA for critical data (no AZ redundancy)
Check your understanding
Answer these without looking back at the article.
- How does S3 Intelligent-Tiering decide when to move objects between tiers?
- What's the difference between Glacier Flexible Retrieval and Deep Archive?
- How do you handle lifecycle for versioned S3 buckets?
- What is S3 Storage Lens and what insights does it provide?
Related interview prep categories
1Looking for a structured roadmap?
Every module on this page is also part of the full Java backend interview track.