3.4.1. S3 Storage Classes and Lifecycle Policies
💡 First Principle: S3 storage classes create a cost-performance spectrum — from S3 Standard (fastest, most expensive) to S3 Glacier Deep Archive (slowest retrieval, cheapest). Lifecycle policies automate transitions between tiers based on object age, ensuring data migrates to the cheapest tier that still meets access requirements.
S3 Intelligent-Tiering deserves special mention: it automatically moves objects between access tiers based on actual usage patterns — no lifecycle policy configuration needed. It adds a small monitoring fee per object but eliminates the guesswork. For data with unpredictable access patterns, Intelligent-Tiering is often the exam's "most cost-effective" answer.
S3 Storage Class Analysis observes access patterns for a bucket, prefix or tag filter (AWS recommends 30 days or more of observation) and shows when data becomes infrequently accessed. Run it before writing lifecycle rules so transitions are based on measured access rather than guesses.
Lifecycle policy configuration. Rules define transitions (move to Standard-IA after 30 days, Glacier after 90 days) and expirations (delete after 365 days). Rules can apply to an entire bucket, a specific prefix, or objects with specific tags. Multiple rules can coexist — the most cost-effective transition takes precedence when rules overlap.
Minimum storage durations. Standard-IA charges for a minimum of 30 days, Glacier Instant Retrieval for 90 days, Glacier Flexible Retrieval for 90 days, and Deep Archive for 180 days. Transitioning data that's deleted before the minimum duration incurs early deletion charges.
⚠️ Exam Trap: Lifecycle transitions have minimum object size requirements. Objects smaller than 128 KB are not transitioned to Standard-IA or One Zone-IA (they're charged at the Standard rate anyway). For data lakes with many small files, consider compacting files before applying lifecycle policies. Since September 2024 this 128 KB default applies to transitions into every storage class, including Glacier, unless a rule sets an object-size filter. Archiving tiny files to Glacier Flexible Retrieval or Deep Archive can cost more than it saves: each object carries 40 KB of overhead (32 KB billed at the Glacier rate plus 8 KB at the S3 Standard rate), and each transition is a billed request.
Reflection Question: A compliance requirement mandates keeping audit logs for 7 years. Logs are queried actively for 90 days, occasionally for 1 year, and never after that (but must be retrievable within 48 hours for legal requests). Design the lifecycle policy.