S3 Storage Classes and Lifecycle Rules
Swipe um das Menü anzuzeigen
Sven's company stored seven years of customer chat transcripts in S3 — 84 TB total. Most of it had not been accessed in months. The bill was $1,932 a month. He changed two lifecycle rules. The next bill was $312.
This is the most common AWS cost optimization story, and it's exactly what S3 storage classes are designed for.
The Storage Class Lineup
S3 offers six core storage classes that trade off price for retrieval speed and minimum storage duration:
- S3 Standard — the default. Frequent access, millisecond retrieval, highest cost per GB;
- S3 Intelligent-Tiering — S3 automatically moves objects between Frequent, Infrequent, and Archive tiers based on access patterns. Tiny monitoring fee per object, but takes the decision off your plate;
- S3 Standard-IA (Infrequent Access) — cheaper per GB, more expensive per retrieval. Minimum 30-day billing per object;
- S3 One Zone-IA — same as Standard-IA but stored in a single AZ. Cheaper, lower durability if the AZ has a disaster. Good for recreatable data;
- S3 Glacier Instant Retrieval — archive pricing with millisecond retrieval. Minimum 90-day billing;
- S3 Glacier Flexible Retrieval — cheaper archive. Retrieval takes minutes to hours;
- S3 Glacier Deep Archive — the cheapest. Retrieval takes up to 12 hours. Minimum 180-day billing. Roughly, prices range from ~$0.023/GB/month for Standard to ~$0.00099/GB/month for Deep Archive — a 20x difference.
How to Choose
A simple decision flow:
- Accessed daily? → Standard;
- Unpredictable access patterns? → Intelligent-Tiering;
- Accessed less than once a month, needs to be ready instantly? → Standard-IA or Glacier Instant Retrieval;
- Cold archive, retrieval can wait hours? → Glacier Flexible Retrieval or Deep Archive. For Sven's chat transcripts: the last 90 days went in Standard, days 91 to 365 in Standard-IA, and everything older in Glacier Deep Archive. The data was almost never read, so retrieval latency did not matter.
Lifecycle Rules
A lifecycle rule is a policy attached to a bucket that automatically transitions objects between storage classes — or deletes them — after a defined time. Sven's rule, in plain language:
-
For objects with prefix
chats/, after 90 days transition to Standard-IA; -
After 365 days transition to Glacier Deep Archive;
-
After 7 years, expire (delete). Lifecycle rules can target:
-
A whole bucket;
-
A prefix (everything under
logs/2024/); -
A tag (every object tagged
archive=true). The transitions run on AWS's schedule, usually overnight. You do not pay for transitions to Glacier-class storage, but you do pay small transition fees for moves between some classes — around $0.01 per 1,000 objects.
Versioning Adds a Wrinkle
When versioning is enabled, every overwrite or delete creates a new version, and the old one sticks around — accruing storage charges. Lifecycle rules can target noncurrent versions specifically:
- Move noncurrent versions to Glacier after 30 days;
- Permanently delete noncurrent versions older than 365 days. Without this, versioned buckets quietly become very expensive.
Common Mistakes
Three patterns burn money:
- Storing everything in Standard forever — the default, and the most expensive choice;
- Putting objects under 128 KB in IA or Glacier — minimum object size charges kick in and you pay more, not less;
- Forgetting to clean up failed multipart uploads — they sit in the bucket invisibly until a lifecycle rule deletes incomplete uploads. A single lifecycle rule covering all three usually pays for itself within a week.
Danke für Ihr Feedback!
Fragen Sie AI
Fragen Sie AI
Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen