S3 Storage Classes
Comprehensive guide to S3 storage classes and cost optimization strategies
Amazon S3 offers a range of storage classes designed for different access patterns and cost requirements. Choosing the right storage class is critical for optimizing costs while meeting performance needs.
Storage Class Overview
Key Principle
S3 storage classes trade off access speed and cost. Frequently accessed data should use Standard; rarely accessed data should use cheaper archive tiers.
Frequently Accessed Data
S3 Standard
The default storage class for frequently accessed data.
| Attribute | Value |
|---|---|
| Durability | 99.999999999% (11 9's) |
| Availability | 99.99% |
| Availability Zones | ≥3 |
| Minimum Storage Duration | None |
| Minimum Object Size | None |
| Retrieval Fee | None |
| First Byte Latency | Milliseconds |
Use Cases:
- Active application data
- Dynamic website content
- Mobile and gaming applications
- Big data analytics
- Content distribution
aws s3 cp file.txt s3://my-bucket/S3 Intelligent-Tiering
Automatically moves objects between tiers based on access patterns.
| Tier | Access Pattern | Storage Cost |
|---|---|---|
| Frequent Access | Accessed recently | Same as Standard |
| Infrequent Access | Not accessed for 30 days | 40% lower |
| Archive Instant Access | Not accessed for 90 days | 68% lower |
| Archive Access | Not accessed for 90+ days (optional) | 71% lower |
| Deep Archive Access | Not accessed for 180+ days (optional) | 95% lower |
There's a small monthly monitoring and automation charge per object. Best for objects >128KB.
aws s3 cp file.txt s3://my-bucket/ \
--storage-class INTELLIGENT_TIERINGConfigure archive access tiers:
aws s3api put-bucket-intelligent-tiering-configuration \
--bucket my-bucket \
--id my-config \
--intelligent-tiering-configuration '{
"Id": "my-config",
"Status": "Enabled",
"Tierings": [
{
"Days": 90,
"AccessTier": "ARCHIVE_ACCESS"
},
{
"Days": 180,
"AccessTier": "DEEP_ARCHIVE_ACCESS"
}
]
}'Infrequently Accessed Data
S3 Standard-Infrequent Access (Standard-IA)
For data accessed less frequently but requiring rapid access when needed.
| Attribute | Value |
|---|---|
| Durability | 99.999999999% (11 9's) |
| Availability | 99.9% |
| Availability Zones | ≥3 |
| Minimum Storage Duration | 30 days |
| Minimum Object Size | 128KB (charged as 128KB if smaller) |
| Retrieval Fee | Per GB retrieved |
| First Byte Latency | Milliseconds |
Cost Comparison (vs Standard):
- Storage: ~40% cheaper
- Retrieval: Additional fee per GB
Use Cases:
- Backups and disaster recovery
- Long-term storage that needs quick access
- Older data that's occasionally accessed
aws s3 cp file.txt s3://my-bucket/ \
--storage-class STANDARD_IAS3 One Zone-Infrequent Access (One Zone-IA)
Same as Standard-IA but stored in a single Availability Zone.
| Attribute | Value |
|---|---|
| Durability | 99.999999999% (11 9's) within AZ |
| Availability | 99.5% |
| Availability Zones | 1 |
| Minimum Storage Duration | 30 days |
| Minimum Object Size | 128KB |
| Retrieval Fee | Per GB retrieved |
| First Byte Latency | Milliseconds |
Data is lost if the Availability Zone is destroyed. Not recommended for sole copies of critical data.
Cost Comparison (vs Standard-IA):
- Storage: ~20% cheaper than Standard-IA
Use Cases:
- Secondary backups
- Easily reproducible data
- Thumbnails or transcoded media
aws s3 cp file.txt s3://my-bucket/ \
--storage-class ONEZONE_IAArchive Storage Classes
S3 Glacier Instant Retrieval
Archive storage with millisecond retrieval.
| Attribute | Value |
|---|---|
| Durability | 99.999999999% (11 9's) |
| Availability | 99.9% |
| Availability Zones | ≥3 |
| Minimum Storage Duration | 90 days |
| Minimum Object Size | 128KB |
| Retrieval Fee | Per GB |
| First Byte Latency | Milliseconds |
Cost Comparison (vs Standard):
- Storage: ~68% cheaper
- Retrieval: Higher fee than Standard-IA
Use Cases:
- Medical images
- News media archives
- User-generated content archives
- Accessed once per quarter or less
aws s3 cp file.txt s3://my-bucket/ \
--storage-class GLACIER_IRS3 Glacier Flexible Retrieval (formerly Glacier)
Low-cost archive storage with flexible retrieval times.
| Attribute | Value |
|---|---|
| Durability | 99.999999999% (11 9's) |
| Availability | 99.99% (after restore) |
| Availability Zones | ≥3 |
| Minimum Storage Duration | 90 days |
| Minimum Object Size | 40KB overhead |
| First Byte Latency | Minutes to hours |
Retrieval Options:
| Tier | Time | Use Case |
|---|---|---|
| Expedited | 1-5 minutes | Urgent access (costs most) |
| Standard | 3-5 hours | Regular retrieval |
| Bulk | 5-12 hours | Large data sets (cheapest) |
aws s3 cp file.txt s3://my-bucket/ \
--storage-class GLACIERRestore an object:
# Standard retrieval, available for 7 days
aws s3api restore-object \
--bucket my-bucket \
--key my-archive.zip \
--restore-request '{
"Days": 7,
"GlacierJobParameters": {
"Tier": "Standard"
}
}'S3 Glacier Deep Archive
Lowest cost storage for long-term retention.
| Attribute | Value |
|---|---|
| Durability | 99.999999999% (11 9's) |
| Availability | 99.99% (after restore) |
| Availability Zones | ≥3 |
| Minimum Storage Duration | 180 days |
| Minimum Object Size | 40KB overhead |
| First Byte Latency | 12-48 hours |
Retrieval Options:
| Tier | Time | Use Case |
|---|---|---|
| Standard | Within 12 hours | Regular retrieval |
| Bulk | Within 48 hours | Large data sets (cheapest) |
Cost Comparison:
- ~95% cheaper than S3 Standard
- Cheapest AWS storage option
Use Cases:
- Compliance archives (7+ years retention)
- Digital preservation
- Magnetic tape replacement
- Healthcare and financial records
aws s3 cp file.txt s3://my-bucket/ \
--storage-class DEEP_ARCHIVEaws s3api restore-object \
--bucket my-bucket \
--key compliance-record.pdf \
--restore-request '{
"Days": 30,
"GlacierJobParameters": {
"Tier": "Bulk"
}
}'S3 Express One Zone
Newest Storage Class
S3 Express One Zone is designed for performance-critical applications requiring single-digit millisecond latency.
| Attribute | Value |
|---|---|
| Latency | Single-digit milliseconds |
| Requests/sec | Hundreds of thousands |
| Availability Zones | 1 (choose your AZ) |
| Storage Type | Directory buckets |
Use Cases:
- Machine learning training
- Financial modeling
- Real-time analytics
- High-performance computing
aws s3api create-bucket \
--bucket my-bucket--usw2-az1--x-s3 \
--region us-west-2 \
--create-bucket-configuration '{
"Location": {
"Type": "AvailabilityZone",
"Name": "usw2-az1"
},
"Bucket": {
"DataRedundancy": "SingleAvailabilityZone",
"Type": "Directory"
}
}'Reduced Redundancy (Deprecated)
Not Recommended
S3 Reduced Redundancy Storage (RRS) is deprecated. Use S3 One Zone-IA or S3 Standard instead.
Storage Class Comparison Table
| Class | Durability | Availability | AZs | Min Duration | Min Size | Latency |
|---|---|---|---|---|---|---|
| Standard | 11 9's | 99.99% | ≥3 | None | None | ms |
| Intelligent-Tiering | 11 9's | 99.9% | ≥3 | None | None | ms |
| Standard-IA | 11 9's | 99.9% | ≥3 | 30 days | 128KB | ms |
| One Zone-IA | 11 9's | 99.5% | 1 | 30 days | 128KB | ms |
| Glacier Instant | 11 9's | 99.9% | ≥3 | 90 days | 128KB | ms |
| Glacier Flexible | 11 9's | 99.99%* | ≥3 | 90 days | 40KB+ | min-hrs |
| Glacier Deep Archive | 11 9's | 99.99%* | ≥3 | 180 days | 40KB+ | hrs |
| Express One Zone | 11 9's | 99.95% | 1 | 1 hour | None | < 10ms |
*After restore
Changing Storage Classes
aws s3 cp s3://my-bucket/file.txt s3://my-bucket/file.txt \
--storage-class GLACIER_IRaws s3api copy-object \
--bucket my-bucket \
--key file.txt \
--copy-source my-bucket/file.txt \
--storage-class STANDARD_IA \
--metadata-directive COPYUse S3 Batch Operations for large-scale storage class changes:
{
"Spec": {
"Format": "S3BatchOperations_CSV_20180820",
"Fields": ["Bucket", "Key"]
},
"Location": {
"ObjectArn": "arn:aws:s3:::my-bucket/manifest.csv",
"ETag": "abc123"
}
}aws s3control create-job \
--account-id 123456789012 \
--manifest file://manifest.json \
--operation '{
"S3PutObjectCopy": {
"TargetResource": "arn:aws:s3:::my-bucket",
"StorageClass": "GLACIER"
}
}' \
--report '{
"Bucket": "arn:aws:s3:::report-bucket",
"Enabled": true,
"Format": "Report_CSV_20180820",
"ReportScope": "AllTasks"
}' \
--role-arn arn:aws:iam::123456789012:role/S3BatchRole \
--priority 1Automate storage class transitions:
{
"Rules": [
{
"ID": "OptimizeStorage",
"Status": "Enabled",
"Filter": {},
"Transitions": [
{
"Days": 30,
"StorageClass": "STANDARD_IA"
},
{
"Days": 90,
"StorageClass": "GLACIER_IR"
},
{
"Days": 365,
"StorageClass": "DEEP_ARCHIVE"
}
]
}
]
}aws s3api put-bucket-lifecycle-configuration \
--bucket my-bucket \
--lifecycle-configuration file://lifecycle-config.jsonCost Optimization Strategies
Analyze Access Patterns
Use S3 Storage Lens and access logs to understand how data is accessed:
aws s3control put-storage-lens-configuration \
--account-id 123456789012 \
--config-id my-dashboard \
--storage-lens-configuration '{
"Id": "my-dashboard",
"IsEnabled": true,
"AccountLevel": {
"BucketLevel": {
"ActivityMetrics": {
"IsEnabled": true
}
}
}
}'Use Intelligent-Tiering for Unknown Patterns
When you can't predict access patterns:
# In lifecycle rule
{
"Rules": [{
"ID": "DefaultToIntelligentTiering",
"Filter": {"Prefix": ""},
"Status": "Enabled",
"Transitions": [{
"Days": 0,
"StorageClass": "INTELLIGENT_TIERING"
}]
}]
}Set Lifecycle Rules Based on Data Age
Create rules matching your retention requirements:
{
"Rules": [
{
"ID": "LogsLifecycle",
"Status": "Enabled",
"Filter": {"Prefix": "logs/"},
"Transitions": [
{"Days": 30, "StorageClass": "STANDARD_IA"},
{"Days": 90, "StorageClass": "GLACIER"}
],
"Expiration": {"Days": 365}
}
]
}Monitor and Adjust
Regularly review storage costs and adjust policies:
aws cloudwatch get-metric-statistics \
--namespace AWS/S3 \
--metric-name BucketSizeBytes \
--dimensions Name=BucketName,Value=my-bucket Name=StorageType,Value=StandardStorage \
--start-time 2024-01-01T00:00:00Z \
--end-time 2024-01-31T23:59:59Z \
--period 86400 \
--statistics AverageBest Practices
Storage Class Selection Guidelines
- Standard: Default for active data with unpredictable access
- Intelligent-Tiering: Best for large objects with unknown access patterns
- Standard-IA: Data accessed monthly, needs quick access
- One Zone-IA: Reproducible data, secondary copies
- Glacier Instant: Quarterly access, millisecond retrieval needed
- Glacier Flexible: Annual access, can wait hours
- Deep Archive: Rarely accessed, compliance/legal requirements