Lesson 3 of 3 Amazon S3 Performance and Data Transfer

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.

ClassAccess patternMinimum durationRetrieval
StandardFrequentNoneImmediate
Intelligent-TieringUnknown or changingNoneImmediate (archive tiers optional)
Standard-IAInfrequent, multi-AZ30 daysImmediate, per-GB fee
One Zone-IAInfrequent, re-creatable30 daysImmediate, per-GB fee
Glacier Instant RetrievalQuarterly90 daysMilliseconds
Glacier Flexible RetrievalArchive90 daysMinutes to 12 hours
Glacier Deep ArchiveLong-term archive180 days12 to 48 hours
Sort into groups

Which storage class?

Exam skills 1.3.3

Choose the storage class for each access pattern.

Log in to try this activity Interactive activities are free with an account.

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 for log objects. Objects move down the waterfall from S3 Standard to Standard-IA after 30 days, then to Glacier Flexible Retrieval, and expire after a year. Objects smaller than 128 KB are not transitioned by default, and lifecycle actions run asynchronously, so transitions can be delayed.
The days after the 30-day minimum are illustrative.
Put in order

A lifecycle rule

Exam skills 1.3.3

Put the stages of a log object's life under a lifecycle rule in order.

Log in to try this activity Interactive activities are free with an account.

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.

Scenario questions

Finding storage savings

Exam skills 1.3.3

Choose the S3 analytics feature for each question.

Log in to try this activity Interactive activities are free with an account.
Worked example

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.

Check yourself

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.