Optimising Storage Cost with Classes, Lifecycle Rules and Storage Lens
This lesson explains how S3 Lifecycle, Intelligent-Tiering and Storage Lens keep each object in the cheapest class that meets its access needs and make storage efficiency visible.
Learning outcomes
After completing this lesson, you will be able to:
- Choose storage classes by access pattern.
- Write lifecycle rules, including for noncurrent versions and incomplete uploads.
- Find savings with S3 Storage Lens.
Storage classes
S3 offers classes with different prices, minimum storage durations and retrieval models. S3 Standard is for frequently accessed data. S3 Intelligent-Tiering moves each object between frequent, infrequent (after 30 days) and archive instant access (after 90 days) tiers based on access, with optional asynchronous archive tiers, for a small monitoring fee and no retrieval charges. S3 Standard-IA and S3 One Zone-IA are cheaper for data accessed less than monthly, with retrieval fees and a 30-day minimum; One Zone-IA stores data in a single AZ. S3 Glacier Instant Retrieval gives millisecond access to archive data accessed about once a quarter; Glacier Flexible Retrieval (minutes to hours) and Glacier Deep Archive (hours, lowest cost) are for archives.
| Class | Access pattern | Minimum duration | Retrieval |
|---|---|---|---|
| Standard | Frequent | None | Immediate |
| Intelligent-Tiering | Unknown or changing | None | Immediate (archive tiers optional) |
| Standard-IA | Infrequent, multi-AZ | 30 days | Immediate, per-GB fee |
| One Zone-IA | Infrequent, re-creatable | 30 days | Immediate, per-GB fee |
| Glacier Instant Retrieval | Quarterly | 90 days | Milliseconds |
| Glacier Flexible Retrieval | Archive | 90 days | Minutes to 12 hours |
| Glacier Deep Archive | Long-term archive | 180 days | 12 to 48 hours |
Which storage class?
S3 Lifecycle rules
A lifecycle configuration contains rules, each filtered by prefix, tags or object size, with transition actions (move objects to another class after a number of days) and expiration actions (delete objects, expire noncurrent versions, remove expired delete markers, abort incomplete multipart uploads). Transitions follow a waterfall from warmer to colder classes, objects must usually stay 30 days in Standard before moving to Standard-IA, and objects smaller than 128 KB are not transitioned by default because the per-object overhead outweighs the savings. Lifecycle actions run asynchronously, so there can be a delay before an object is transitioned or deleted.
{
"Rules": [{
"ID": "logs-tiering",
"Filter": {"Prefix": "logs/"},
"Status": "Enabled",
"Transitions": [
{"Days": 30, "StorageClass": "STANDARD_IA"},
{"Days": 90, "StorageClass": "GLACIER"}
],
"Expiration": {"Days": 365},
"NoncurrentVersionExpiration": {"NoncurrentDays": 30},
"AbortIncompleteMultipartUpload": {"DaysAfterInitiation": 7}
}]
}The following diagram shows a typical rule for log objects.

A lifecycle rule
S3 Storage Lens and analytics
S3 Storage Lens provides organisation-wide dashboards of storage usage and activity metrics, aggregated by account, Region, bucket and prefix, with recommendations such as buckets without lifecycle rules for incomplete multipart uploads or with many noncurrent versions. Free metrics cover usage; advanced metrics add activity, prefix-level detail and CloudWatch publishing. Storage Class Analysis observes access patterns on a bucket or prefix to suggest when to transition to Standard-IA, and S3 Inventory lists objects and their metadata daily or weekly for audits and Batch Operations.
Finding storage savings
Reducing the storage bill
Storage Lens shows that one bucket holds 400 TB, of which 120 TB are noncurrent versions and 15 TB are incomplete multipart uploads. Access patterns for the current data are unpredictable because analysts query old data at random. The team adds a lifecycle rule that expires noncurrent versions after 30 days and aborts incomplete uploads after 7 days, and transitions current objects larger than 128 KB to Intelligent-Tiering after 0 days, which avoids retrieval fees for the random access. The bill falls by more than a third with no change to applications.
What is the minimum storage duration charged for S3 Glacier Deep Archive?
Show answer
180 days.
Exam Tips
Remember for the exam
- Unknown access patterns: Intelligent-Tiering (no retrieval fees).
- Lifecycle rules transition and expire objects, noncurrent versions and incomplete uploads.
- Minimum durations: 30 days for IA classes, 90 for Glacier Instant/Flexible, 180 for Deep Archive.
- Storage Lens shows usage and recommendations across accounts.