AWS Certified Solutions Architect – Associate
S3 storage classes and lifecycle rules: which one, when
Choose an S3 storage class by how often the data is read, how fast it must come back, and how long it will stay. Infrequent-access and Glacier classes cost less to store but add retrieval fees, minimum storage durations and, for most of them, a 128 KB minimum billable size. Lifecycle rules move objects down to cheaper classes over time, and only in one direction.
The classes and their minimums
S3 Standard has no minimum duration or size and is for data read more than once a month. S3 Standard-IA and S3 One Zone-IA give millisecond access with a per-GB retrieval fee, a 30-day minimum storage duration and a 128 KB minimum billable object size. An object under 128 KB is billed as 128 KB.
S3 One Zone-IA stores data in one Availability Zone. It is designed for the same 99.999999999% durability as Standard-IA, but for 99.5% availability instead of 99.9%, and it does not survive the loss of that zone. AWS recommends it only for data you can re-create.
S3 Glacier Instant Retrieval gives millisecond access for data read about once a quarter, with a 90-day minimum and a 128 KB minimum size. S3 Glacier Flexible Retrieval has a 90-day minimum and S3 Glacier Deep Archive a 180-day minimum. Objects in those two must be restored with RestoreObject before you can read them, and each archived object carries 40 KB of extra metadata.
Deleting, overwriting or transitioning an object before its minimum duration still charges the remaining days.
S3 Intelligent-Tiering
Intelligent-Tiering is for data with unknown or changing access patterns. It charges a small monthly monitoring fee per object and no retrieval fees. Objects move to the Infrequent Access tier after 30 days without access and to the Archive Instant Access tier after 90 days. All three of these tiers return data in milliseconds.
Two optional tiers, Archive Access (from 90 days) and Deep Archive Access (from 180 days), must be activated. Objects in them must be restored before they can be read, so turn them on only if the application can wait.
Objects smaller than 128 KB are not monitored and always stay in the Frequent Access tier.
Glacier retrieval options
For Glacier Flexible Retrieval, Expedited typically takes 1 to 5 minutes, Standard 3 to 5 hours and Bulk 5 to 12 hours. Bulk retrievals from this class are free. For Glacier Deep Archive, Expedited is not available, Standard finishes within 12 hours and Bulk within 48 hours.
Provisioned capacity guarantees that Expedited retrievals are accepted when demand is high. Without it, Expedited requests can be refused.
Lifecycle transitions
Lifecycle rules follow a waterfall: Standard can move to any colder class, Standard-IA to Intelligent-Tiering, One Zone-IA or a Glacier class, and Glacier Flexible Retrieval only to Deep Archive. No rule moves an object back up. To bring archived data back to a warmer class, restore it and copy it.
By default, lifecycle rules do not transition objects smaller than 128 KB, because the per-object transition request can cost more than the storage it saves. An object size filter can override this. A rule also cannot transition an object out of a class before that class's minimum duration has passed.
Where the exam catches people
- Believing Standard-IA is cheaper at any object size: objects under 128 KB are billed as 128 KB.
- Believing One Zone-IA is less durable than Standard-IA: both are designed for 11 nines of durability. One Zone-IA is less available and does not survive the loss of its zone.
- Believing Intelligent-Tiering will tier small files: objects under 128 KB are never monitored and stay in Frequent Access.
- Believing every Intelligent-Tiering tier is instant: the optional Archive Access and Deep Archive Access tiers need a restore first.
- Believing a lifecycle rule can move data from Glacier Deep Archive back to Standard: transitions only go down, so you must restore and copy.