AWS SAA-18: Amazon S3(Part-2)

Kiran Chhablani
4 min readOct 12, 2023

--

S3 versioning, S3 replication, S3 storage class, Lifecycle rules, storage class analysis

S3 Versioning

  • You can version your files in Amazon S3
  • It is enabled at the bucket level
  • Same key overwrite will change the version 1,2,3,….
  • It is best practice to version your buckets
  • — protect against unintended deletes (ability to restore a version)
  • — easy roll back to previous version
  • Note:
  • — any file that is not versioned prior to enabling versioning will have version “null”
  • — suspending versioning does not delete the previous versions

S3 Replication (CRR and SRR)

  • Must enable versioning in source and destination buckets
  • Cross-Region Replication and Same-Region Replication
  • Buckets can be in different AWS accounts
  • Copying is asynchronous
  • Must give proper IAM permissions to S3
  • Use case: CRR — compliance, low latency access, replication across accounts SRR — log aggregation, live replication between production and test account
  • After you enable replication, only new objects are replicated
  • Optionally, you can replicate existing objects using S3 Batch Replication
  • — Replications existing objects and objects that failed replicating
  • For DELETE operations:
  • — can replicate delete markers from source to target
  • — deletions with a version ID are not replicated (to avoid malicious deletes)
  • There is no “chaining” of replication
  • — if b1 has replication into b2, which has replication in b3, the objects created in b1 are not replicated to b3

S3 Storage Classes

Durability

  • High durability (99.99999999999%) of object across multiple AZ
  • If you store 10,000,000 objects in S3, you can on average expect to incur a loss of a single object every 10,000 years
  • Same for all storage classes

— Availability

  • Measures how readily available a service is
  • Varies depending on storage class
  • E.g. S3 Std. has 99.99% availability = not available 53 minutes a year
  1. S3 Standard — General Purpose
  • 99.999% availability
  • Used for frequently accessed data
  • Low latency and high throughput
  • Sustain 2 concurrent facility failures
  • Use case: Big Data analytics, Mobile and Gaming application, content distribution

2. S3 — Infrequent Access

  • For data that is less frequently accessed, but requires rapid access when needed
  • Lower cost than S3 standard
  • Amazon S3 Std-Infrequent Access (S3 Std-IA): 99.9% availability, use case — disaster recovery, backups
  • Amazon S3 One Zone-Infrequent Access:
  • — — high durability in a single AZ, data lost when AZ is destroyed
  • — — 99.5% availability
  • — — use case: storing secondary backup copies of on-premise data or data you can recreate

Amazon S3 Glacier Storage Classes

  • Low-cost object storage meant for archiving backup
  • Pricing: price for storage + object retrieval cost

3. Amazon S3 Glacier — Instant Retrieval

  • Millisecond retrieval, great for data accessed once a quarter
  • Minimum storage duration of 90 days

4. Amazon S3 Glacier — Flexible Retrieval

  • Expedited(1 to 5 min), standard (3 to 5 hr), bulk (5 to 12 hr) — free
  • Minimum storage duration of 90 days

5. Amazon S3 Glacier — Deep Archive

  • For long term storage
  • Standard (12 hr), bulk (48 hr)
  • Minimum storage duration of 180 days

6. S3 Intelligent Tiering

  • Small monthly monitoring and auto-tiering fee
  • Moves objects automatically between Access Tiers based on usage
  • There are no retrieval charges in S3 Intelligent Tiering
  1. Frequent Access Tier(automatic): default Tier
  2. Infrequent Access Tier(automatic): object not accessed for 30 days
  3. Archive Instant Access Tier(automatic): object not accessed for 90 days
  4. Archive Access Tier(optional): configurable for 90 days to 700+ days
  5. Deep Archive Access Tier(optional): configurable from 180 days to 700+ days

Moving between Storage Classes

  • You can transition objects between storage classes
  • For infrequently accessed object, move them to standard IA
  • For archive objects that you don’t need fast access to, move them to Glacier or Glacier Deep Archive
  • Moving objects can be automated using a lifecycle rules

Lifecycle Rules

  • Transition Actions: configure objects to transition to another storage class
  • — Move object to standard IA class 60 days after creation
  • — Move to Glacier for archiving after 6 months
  • Expiration Action: configure objects to expire(delete) after some time
  • — Access log files can be set to delete after 365 days
  • — Can be used to delete old versions of files (if versioning is enabled)
  • — Can be used to delete incomplete Multi-Part upload
  • Rules can be created for a certain prefix
  • Rules can be created for certain object tags

S3 Analytics — Storage Class Analysis

  • Helps you decide when to transition objects to the right storage class
  • Recommendations for standard and standard IA
  • Does not work for One Zone-IA or Glacier
  • Report is updated daily
  • 24 to 48 hr to start seeing data analysis
  • Good first step to put together Lifecycle Rules (or improve them)

--

--