Storage Tiers and Lifecycle
Pay for access, not just bytes
Storage tiers trade price for access latency. Lifecycle policies age data automatically from hot to archive and delete it when obsolete — turning 'cleanup' from a manual chore into a declarative rule.
What you will learn
- Explain the hot/cool/cold/archive price-latency ladder
- Configure lifecycle transitions that age data safely
- Compare Intelligent-Tiering, blob access tiers and GCS classes
Hot tiers cost more per GB and read instantly; archive tiers are ~10x cheaper but need hours to retrieve. Lifecycle rules move objects by age or size automatically, and delete them at expiry.
What is this?
S3 classes: STANDARD → IA → Glacier Instant/IR → Glacier Flexible → Glacier Deep Archive; plus S3 Intelligent-Tiering (auto monitor/move). Azure Blob access tiers: Hot → Cool → Cold → Archive (rehydrate before read). GCS classes: Standard → Nearline → Coldline → Archive, with 'Autoclass' auto-tiering. Transitions charge a data-access fee + minimum 30/90-day storage: small short-lived objects in IA can cost more than STANDARD.
Why do you need it?
- Archives are 80-90% cheaper for the same bytes when rarely accessed.
- Lifecycle prevents unbounded growth: expiry deletes logs/old versions automatically.
- Tiering discipline keeps hot storage bill stable as data grows.
- Declarative rules pass an audit: 'logs expire after 90 days', not 'someone should delete them'.
Mental model
Files moved from desk drawer to filing cabinet to off-site storage warehouse
Storage lifecycle tiers
Keep the report you're reading today in the drawer (hot), year-old ones in the cabinet (cold-ish), and closed case files in the warehouse (archive) — with a courier when you finally need one.
How it works
- Lifecycle rule = filter (prefix/tags) + actions (transition to tier after N days, expire after N days).
- Archive retrieval requires a restore job (Glacier/Archive rehydration) taking minutes to hours.
- Transitions are one-way for single-tier rules; Intelligent-Tiering/Autoclass move both ways automatically.
- Sizes below 128KB and ages under 30/90 days often not worth transitioning.
- Versioned buckets: apply expiration to noncurrent versions to prune history.
Lifecycle aging chain.
Examples
A lifecycle policy that ages and purges data
# AWS S3 lifecycle JSON intent:# - move to IA after 30 days# - move to Glacier Deep Archive after 365 days# - expire (delete) after 1825 daysaws s3api put-bucket-lifecycle-configuration --bucket my-bucket \ --lifecycle-configuration '{ "Rules": [{ "ID": "logs-aging", "Filter": {"Prefix": "logs/"}, "Status": "Enabled", "Transitions": [ {"Days": 30, "StorageClass": "STANDARD_IA"}, {"Days": 365, "StorageClass": "DEEP_ARCHIVE"} ], "Expiration": {"Days": 1825} }] }'One rule ages logs cheaply and deletes them after five years — no cron cleanup job needed.
In production
- Analytics pipelines move raw parquet to Glacier after 30 days but keep 1 year hot for dashboards.
- Azure storage auto-tiering keeps user-upload scans in hot then archives after 90 days.
- GCS Autoclass moves report outputs cold automatically, cutting a storage bill 35%.
Best practices
- Tie expiry to compliance policy and document the retention reasons.
- Test lifecycle on a staging prefix before production (data can only leave expensive tiers).
- Use Intelligent-Tiering/Autoclass when access patterns are unpredictable.
- Watch minimum-duration fees: tiny/short-lived objects should stay hot.
Common mistakes
- Transitioning small objects to IA and paying minimum-30-day fees that exceed hot cost.
- Deleting versions/lifecycle accidentally: versioned buckets need noncurrent-expiration, not deletion.
- Putting a live website on Glacier — first visitor rehydrates for 3 hours, static site 'down'.
- Forgetting data-access fees when transitioning huge datasets.
Common issues
Objects never reach archiveLifecycle rule filter mismatch or transition disabled
Verify prefix/tags match objects exactly and the rule State is Enabled with the right days.
Archive cost climbing unexpectedlyObjects shuffle between tiers on re-reads
Convert to Intelligent-Tiering or define clear access patterns before tiering.
Debugging tips
- Check lifecycle policy for overlaps: two rules matching the same object cause churn.
- Object stuck mid-tier after transition failed → inspect the bucket inventory for storage class.
- Restore of archived object slow: request the restore and poll; Deep Archive restores take up to 12h.
- Bill anomaly = tier piling: use cost breakdown by storage class to find it.
Interview checkpoint
Hands-on lab
- Design a tiering+expiry rule for a real data set
- Translate it into an S3/Blob/GCS lifecycle config
- Weigh small-object and minimum-duration traps
Write and Simulate a Storage Lifecycle Policy
25 min · intermediate
Quick quiz
Archive tiers retrieve as fast as hot tiers.