The most surprising thing about AWS S3 storage classes is that they aren’t just about where your data lives, but when and how you access it, fundamentally changing your cost and retrieval patterns.
Let’s see this in action. Imagine you have a web application serving user-uploaded images and a nightly backup job.
First, the images: they’re accessed frequently, maybe thousands of times a day. For this, S3 Standard is your go-to. It’s designed for frequent access, low latency, and high durability.
aws s3api put-bucket-lifecycle-configuration --bucket my-image-bucket --lifecycle-configuration '{
"Rules": [
{
"ID": "StandardAccess",
"Filter": {
"Prefix": ""
},
"Status": "Enabled",
"Transitions": [
{
"Days": 30,
"StorageClass": "STANDARD_IA"
},
{
"Days": 90,
"StorageClass": "ONEZONE_IA"
}
],
"Expiration": {
"Days": 365
}
}
]
}'
Here, we’re setting up a lifecycle policy. Objects in my-image-bucket will stay in S3 Standard for 30 days. After that, they’ll automatically transition to STANDARD_IA (Infrequent Access). After 90 days, they move to ONEZONE_IA (One Zone Infrequent Access). Finally, after a year, they’re expired and deleted. S3 Standard costs about $0.023 per GB/month, STANDARD_IA is $0.0125 per GB/month, and ONEZONE_IA is even cheaper at $0.01 per GB/month. The trade-off is retrieval fees: STANDARD_IA and ONEZONE_IA charge per object retrieved ($0.01 per 1,000 objects for IA, $0.015 for One Zone IA) and per GB retrieved ($0.01 per GB for IA, $0.02 for One Zone IA). S3 Standard has no retrieval fees.
Now, the nightly backups: these are accessed very rarely, perhaps only during a disaster recovery scenario. For this, S3 Glacier Deep Archive is perfect.
aws s3api put-bucket-lifecycle-configuration --bucket my-backup-bucket --lifecycle-configuration '{
"Rules": [
{
"ID": "BackupArchive",
"Filter": {
"Prefix": "daily_backups/"
},
"Status": "Enabled",
"Transitions": [
{
"Days": 7,
"StorageClass": "GLACIER"
}
],
"Expiration": {
"Days": 3650
}
}
]
}'
This policy sends data prefixed with daily_backups/ in my-backup-bucket to S3 Glacier after 7 days. S3 Glacier costs a mere $0.004 per GB/month. If you need even cheaper storage for data you’ll almost never need, S3 Glacier Deep Archive is $0.00099 per GB/month. The catch? Retrieval times. Standard Glacier retrieval takes 3-5 hours and costs $0.05 per GB. Deep Archive retrieval takes 12-48 hours and costs $0.02 per GB.
This brings us to S3 Intelligent-Tiering. This class acts as an automatic tiering service. It monitors access patterns and automatically moves data between frequent access (like Standard) and infrequent access tiers. It has a small monthly monitoring and automation fee ($0.0025 per GB), but can save you significant money if your access patterns are unpredictable or mixed. You can configure it to archive data to Glacier Instant Retrieval, Glacier Flexible Retrieval, or Glacier Deep Archive after certain inactivity periods.
aws s3api put-bucket-lifecycle-configuration --bucket my-intelligent-bucket --lifecycle-configuration '{
"Rules": [
{
"ID": "IntelligentTiering",
"Filter": {
"Prefix": ""
},
"Status": "Enabled",
"Transitions": [
{
"Days": 30,
"StorageClass": "INTELLIGENT_TIERING"
}
],
"NoncurrentVersionTransitions": [
{
"NoncurrentDays": 30,
"StorageClass": "INTELLIGENT_TIERING"
}
],
"IntelligentTieringConfiguration": {
"DaysAfterInitialization": 0,
"Frequency": "ALL_ACCESS_LEVELS",
"Tierings": [
{
"ArchiveTier": "ARCHIVE_ACCESS",
"DaysBeforeArchive": 180
},
{
"ArchiveTier": "DEEP_ARCHIVE_ACCESS",
"DaysBeforeArchive": 360
}
]
}
}
]
}'
This configuration tells Intelligent-Tiering to monitor objects in my-intelligent-bucket. After 30 days of inactivity, it will move data to its own internal frequent access tier. After 180 days of inactivity, it will archive to Glacier Instant Retrieval (which offers milliseconds retrieval but at a higher cost than standard IA), and after 360 days, it will move to Glacier Deep Archive. The key is that Intelligent-Tiering handles the transitions between its own tiers and the archival tiers automatically based on observed access.
The choice between these classes boils down to a cost-benefit analysis of access frequency, retrieval time requirements, and retrieval costs. S3 Standard is for critical, frequently accessed data. STANDARD_IA and ONEZONE_IA are for data accessed less frequently but still needs relatively quick retrieval, with ONEZONE_IA being cheaper but less resilient as it stores data in a single Availability Zone. Glacier and Glacier Deep Archive are for long-term archival where retrieval time and cost are secondary to storage cost. Intelligent-Tiering offers a managed approach to optimize costs across different access patterns without manual intervention.
The next thing you’ll likely grapple with is managing object versions and their associated storage costs across these different tiers.