Lesson 1 of 4 Storage Services

Storing Objects with Amazon S3 and Choosing Storage Classes

This lesson explains how Amazon Simple Storage Service (Amazon S3), one of the most important services in the exam, provides scalable object storage for almost any kind of data, and how its storage classes and lifecycle policies balance price against access.

Learning outcomes

After completing this lesson, you will be able to:

  • Describe how Amazon S3 stores data as objects in buckets.
  • Identify the features that secure and protect S3 data, such as Block Public Access and versioning.
  • Choose an S3 storage class from how often data is used and how quickly it must be retrieved.
  • Explain how lifecycle policies move objects to cheaper classes and delete them.

How S3 works

Amazon S3 stores data as objects in buckets. The following list describes how the service works.

  • Data is stored as objects (a file plus metadata) in buckets with globally unique names.
  • Storage is virtually unlimited; one object can be up to 50 TB.
  • Designed for 99.999999999% (eleven nines) durability by storing data across several Availability Zones.

Common uses: backup and restore, archiving, data lakes, app images and video, software distribution and static websites.

11nines

Designed durability (99.999999999%)

50TB

Maximum size of one object

Security and protection

Amazon S3 provides several features that secure and protect stored data. The following list describes them.

  • Buckets are private unless you open them; S3 Block Public Access prevents accidental exposure.
  • Bucket policies and IAM policies control access.
  • New objects are encrypted by default.
  • S3 Versioning keeps earlier versions, so you can recover from accidental deletion or overwrites.
True or false

S3 facts

Exam skills 3.6.1

Check the facts about S3 and how it protects data.

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

Storage classes

S3 storage classes balance the price of storing data against how quickly and cheaply it can be retrieved. S3 Standard is for data used often. S3 Intelligent-Tiering is for data whose use is unknown or changes: it moves each object automatically to a cheaper tier when it is not being used. S3 Standard-IA (infrequent access) costs less to store but charges a fee to retrieve data, for data that is used rarely but must be available immediately. S3 One Zone-IA is cheaper again because it keeps data in one Availability Zone, so it suits data that can be re-created.

The Glacier classes are for archives. S3 Glacier Instant Retrieval still returns data in milliseconds. S3 Glacier Flexible Retrieval takes minutes to hours to retrieve data, and S3 Glacier Deep Archive is the cheapest class of all, for data kept for years, and takes hours to retrieve. The following table summarises the classes, from the most expensive to store to the least.

ClassUse forRetrieval
S3 StandardFrequently accessed dataMilliseconds
S3 Intelligent-TieringUnknown or changing access patterns; moves objects between tiers automaticallyMilliseconds for frequent and infrequent tiers
S3 Standard-IAInfrequently accessed data needed quicklyMilliseconds, with a retrieval fee
S3 One Zone-IAInfrequent, re-creatable data in one AZ; cheaperMilliseconds, with a retrieval fee
S3 Glacier Instant RetrievalArchives needing fast accessMilliseconds
S3 Glacier Flexible RetrievalArchivesMinutes to hours
S3 Glacier Deep ArchiveLong-term retention at the lowest costWithin hours
Scenario questions

Choosing a storage class

Exam skills 3.6.2

Choose the S3 storage class for each kind of data.

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

Lifecycle policies

S3 Lifecycle policies automatically transition objects to cheaper classes as they age, for example to Standard-IA after 30 days and Glacier after 90, and expire (delete) them after a set time.

The following diagram shows the storage class at each age of an object.

An S3 Lifecycle policy. As objects age and are accessed less, the policy moves them automatically to cheaper storage classes, for example from S3 Standard to S3 Standard-IA after 30 days and to S3 Glacier after 90 days, and can delete them after a set time. Each move lowers the storage price as access becomes rarer.
Each move lowers the storage price as access becomes rarer.
Put in order

An object's lifecycle

Exam skills 3.6.6

Put the stages of a typical S3 Lifecycle policy in order.

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

A lifecycle for invoices

A company stores scanned invoices in S3. Staff look at recent invoices often, rarely open ones older than a month, and must keep them for seven years for tax purposes. A lifecycle rule moves each invoice to cheaper storage as it ages:

AgeStorage classWhy
0-30 daysS3 StandardFrequent access
30-90 daysS3 Standard-IAOccasional access, still needed quickly
90 days-7 yearsS3 Glacier Deep ArchiveLowest cost; retrieval within hours is acceptable for audits
After 7 yearsDeleted (expiration)No longer required

The rule runs automatically, and versioning protects against accidental deletion in the meantime. If the company could not predict how often invoices are opened, S3 Intelligent-Tiering would move them between tiers automatically instead.

Check yourself

Which S3 storage class costs least for archives that are rarely accessed?

Show answer

S3 Glacier Deep Archive, whose retrievals take hours.

Exam Tips

Remember for the exam

  • Unknown or changing access patterns suit S3 Intelligent-Tiering.
  • The lowest-cost long-term archive is S3 Glacier Deep Archive.
  • To move old data to cheaper classes automatically, use S3 Lifecycle policies.
  • To recover from accidental deletion, use S3 Versioning.
  • S3 is designed for eleven nines of durability.
  • To host a static website, use S3, often with CloudFront.