S3 Storage Classes

Difficulty: Intermediate

Question

Compare S3 Standard, S3 Standard-IA and the S3 Glacier classes. How do you decide which storage class to use and move data between them?

Answer

S3 Standard is for frequently accessed data with millisecond access and no retrieval fee. S3 Standard-IA (Infrequent Access) stores data for less per GB but charges a per-GB retrieval fee and has a 30-day minimum, so it suits data read a few times a month. The Glacier classes are for archives: Glacier Instant Retrieval still returns data in milliseconds, while Glacier Flexible Retrieval and Deep Archive are the cheapest but need minutes to hours to restore an object before you can read it.

The classes side by side

ClassRetrievalMin storage durationRetrieval feeTypical use
StandardMillisecondsNoneNoActive app data, images, static sites
Intelligent-TieringMilliseconds (archive tiers optional)NoneNoUnknown or changing access patterns
Standard-IAMilliseconds30 daysYesBackups, older user uploads
One Zone-IAMilliseconds, single AZ30 daysYesRe-creatable data like thumbnails
Glacier Instant RetrievalMilliseconds90 daysYes, higherMedical images, archives read once a quarter
Glacier Flexible RetrievalMinutes to hours after restore90 daysYesArchives with no urgency
Glacier Deep ArchiveWithin 12 hours (standard)180 daysYesCompliance data kept 7 to 10 years

All classes except One Zone-IA (and S3 Express One Zone) store data across at least three AZs and are designed for 99.999999999% (11 nines) durability. Availability differs: Standard is designed for 99.99%, Standard-IA for 99.9%, One Zone-IA for 99.5%.

Hidden costs that change the answer

  • Minimum object size: IA and Glacier Instant Retrieval bill each object as at least 128 KB. Millions of tiny log lines can cost more in IA than in Standard.
  • Minimum duration: deleting a Standard-IA object after 10 days still bills 30 days.
  • Requests and retrieval fees: a "cold" bucket that is suddenly scanned by an analytics job can generate a big retrieval bill.
  • Glacier restore tiers: Flexible Retrieval offers Expedited (1 to 5 minutes), Standard (3 to 5 hours) and Bulk (5 to 12 hours); Deep Archive offers Standard (within 12 hours) and Bulk (within 48 hours).

Moving data automatically

Use lifecycle rules rather than manual copies. A typical rule for a fintech storing KYC documents: keep in Standard for 30 days, move to Standard-IA, then to Glacier Deep Archive after a year, and expire after the retention period. Lifecycle transitions to Standard-IA or One Zone-IA require objects to be at least 30 days old.

If you cannot predict access, use Intelligent-Tiering. It moves each object between Frequent, Infrequent (after 30 days without access) and Archive Instant Access (after 90 days) tiers automatically, with no retrieval fees, for a small per-object monitoring charge. Objects under 128 KB are not monitored or tiered.

How to choose in an interview

  1. How often is the data read, and how fast must it come back?
  2. How long will it be kept?
  3. What is the object size distribution?
  4. Can it be regenerated if an AZ is lost?

Answering those four questions leads you to the class almost every time.

A typical S3 lifecycle for user documents. Lifecycle rules move objects to cheaper classes as they age, then delete them when retention ends.
  1. Day 0: upload to S3 Standard: Frequently viewed, no retrieval fee.
  2. Day 30: transition to Standard-IA: Rarely read but still needed instantly.
  3. Day 180: transition to Glacier Instant Retrieval: Read maybe once a quarter.
  4. Day 365: transition to Glacier Deep Archive: Kept only for compliance.
  5. Year 8: expire the object: Retention period over, storage cost drops to zero.

Code examples

Lifecycle configuration with transitions and expiry

{
  "Rules": [
    {
      "ID": "kyc-docs-tiering",
      "Status": "Enabled",
      "Filter": { "Prefix": "kyc/" },
      "Transitions": [
        { "Days": 30,  "StorageClass": "STANDARD_IA" },
        { "Days": 180, "StorageClass": "GLACIER_IR" },
        { "Days": 365, "StorageClass": "DEEP_ARCHIVE" }
      ],
      "Expiration": { "Days": 2920 },
      "NoncurrentVersionExpiration": { "NoncurrentDays": 30 }
    }
  ]
}

Apply this with aws s3api put-bucket-lifecycle-configuration --bucket my-bucket --lifecycle-configuration file://lifecycle.json. Note GLACIER_IR and DEEP_ARCHIVE are the API names for those classes.

Upload directly to a class and restore from Glacier

# Upload straight into Intelligent-Tiering
aws s3 cp report.pdf s3://acme-archive/reports/ --storage-class INTELLIGENT_TIERING

# Restore a Glacier Flexible Retrieval object for 7 days using the Bulk tier
aws s3api restore-object \
  --bucket acme-archive --key logs/2023/app.log.gz \
  --restore-request '{"Days":7,"GlacierJobParameters":{"Tier":"Bulk"}}'

# Check restore status (look for ongoing-request="false")
aws s3api head-object --bucket acme-archive --key logs/2023/app.log.gz

A restore creates a temporary readable copy; the archived object stays in its Glacier class.

Key points

  • Standard: frequent access, no retrieval fee. Standard-IA: cheaper storage, retrieval fee, 30-day minimum.
  • Glacier Instant Retrieval is milliseconds; Flexible Retrieval and Deep Archive need a restore first.
  • Minimum durations: 30 days (IA), 90 days (Glacier IR and Flexible), 180 days (Deep Archive).
  • IA classes bill objects as at least 128 KB, so tiny objects can cost more there.
  • Intelligent-Tiering is the safe default when access patterns are unknown.

Common follow-up questions

  • How does S3 Intelligent-Tiering decide when to move an object?
  • When would One Zone-IA be an acceptable choice?
  • What is S3 Express One Zone and when is it useful?
  • How would you estimate whether moving a bucket to Standard-IA saves money?

Interview tips

  • Mention minimum duration and minimum object size; they show you understand the real cost model.
  • Separate durability (11 nines for most classes) from availability (which differs per class).
  • Close with lifecycle rules or Intelligent-Tiering, because interviewers want automation, not manual moves.

Concepts covered

S3 Standard, S3 Standard-IA, S3 Intelligent-Tiering, S3 Glacier, Lifecycle policies

More AWS & Cloud Fundamentals questions