[AWS] S3 Storage Classes and Versioning

S3 Storage Classes (Storage Tier) – cost, durability, and availability – can be changed manually or using lifecycle policies.

Link: https://aws.amazon.com/s3/storage-classes/

  • Object Durability: The percentage over a one-year period that an object in S3 will not be lost.
  • Object Availability: The percentage over a one-year period that an object in S3 will be accessible.

S3 Tiered Storage Classes

Object Storage Classes – Amazon S3

TierAZ ReplicationAvailabilityLifecycle TransitionFeatures
Standard3+99.99 %YesFor frequently accessed data
Standard IA3+99.9 %YesFast real-time access but less frequently (such as once a month)
One Zone IA1Yesnon-critical or reproducible data
Express One Zone199.95 %NoHIgh-performance, latency-sensitive,
No Lifecycle transition
Intelligent Tiering3+99.9 %YesFor unknown access patterns
Glacier Instant Retrieval3+99.9 %YesIdeal for data that is accessed once or twice per quarter (few tines a year) and that requires immediate access
Glacier Flexible Retrieval3+99.99 %YesBackup and archive data that is rarely accessed.
Glacier Deep Archive3+99.99 %YesArchive data that is very rarely accessed
S3 Classes
  • Glacier Flexible Retrieval
    • Flexible retrieval
      • minutes ~ 12 hours
      • Expedited: 1 ~ 5 minutes
      • Standard: 3 ~ 5 hours
  • Glacier Deep Archive
    • Retrieval time: ~12 hours
    • Bulk Retrieval time: ~ 48 hours
  • Intelligent Tiering
    • only for objects bigger than 128 kB
    • for unknown or unpredictable access patterns
    • A minimum 30 days before transitioning to IA storage tiers.
    • After 30 days, objects that are not accessed are moved to the IA tier.

S3 Pricing

You are changed based on:

  • Object’s size
  • How long you stored the objects during the month
  • Storage Class
TierRetrieval FeeMinimum Size
Charge
Minimum Duration ChargeFeatures
StandardNo N/AN/AMost expensive base fee
Standard IAper GB retrieved128 KB30 daysFast real-time access but less frequently (such as once a month)
One Zone IAper GB retrieved128 KB30 daysnon-critical or reproducible data
Express One ZoneNo N/A1 hourCheaper than the Standard
Intelligent TieringNo128 KBN/AAutomatic cost savings
Glacier Instant Retrievalper GB retrieved128 KB90 days
Glacier Flexible Retrievalper GB retrievedN/A90 daysLow cost
Glacier Deep Archiveper GB retrievedN/A180 daysVery low cost
S3 Pricing

Lifecycle Management

Storage classes can be modified on the fly.

  • Lifecycle rules are added at a bucket level.
    • Lifecycle rules can apply to buckets, prefixes, and tags. Also, they work with current or previous versions of an object.
  • Lifecycle automatically moves objects between the different storage tiers.
    • You can add a rule to a bucket such as Standard -> Glacier -> Delete.
    • Object must stay at least 30 days in S3 Standard before moving to IA or one zone IA. But you can transfer objects directly to Glacier at any time.

S3 Versioning

When the versioning is enabled, any modification of an object generated a new version of the original object.

https://docs.aws.amazon.com/AmazonS3/latest/userguide/versioning-workflows.html

  • Once enabled, S3 stores all versions of an object with previous permissions. It is a great backup tool.
  • Versioning is per bucket and is disabled by default.
  • Once the version is enabled on a bucket, it cannot be disabled – only suspended.
  • AWS charges all versions of all objects.
  • Older versions can be accessed using the object key and a version ID.
  • Specific versions can be deleted. (It is checked with a “delete marker.”)
  • Versioning integrates with Lifecycle rules.
  • Versioning can use with MFA (Multi-Factor Authentication) Delete, which can provide additional security for accidental deletion or overwrite.

S3 Performance

  • Limits
    • 3,500 PUT/POST/DELETE operations per second per prefix
    • 5,500 GET requests per second per prefix.
  • Introduce key randomness (random prefix) to spread load across multiple partitions.
    • Prefix is what is between the bucket name and the object name in URL (folders and sub-folders).
    • You can get better performance by spreading the reads across different prefixes.

When you use SSE-KMS for encryption, KMS has some limits (KMS has a region-specific quota).

  • Use multipart uploads (recommended over 100MB and required over 5GB) to increase upload performance.
  • Use S3 Byte-range fetches: download an object in parallel by specifying byte ranges or download the partial amount of file

Leave a Comment