Every object has a storage class. It decides the price to store a gigabyte, the price to read it, and how fast it comes back.
| Class | For data that is | Read |
|---|---|---|
STANDARD | read often | instantly, no read fee |
INTELLIGENT_TIERING | read unpredictably | instantly; S3 moves it between tiers |
STANDARD_IA | read a few times a month | instantly, with a fee per gigabyte read |
ONEZONE_IA | easy to recreate, read rarely | instantly; kept in one zone only |
GLACIER_IR | archived, read a few times a year | instantly, with a higher read fee |
GLACIER | archived, read rarely | after a restore, minutes to hours (lesson 6) |
DEEP_ARCHIVE | kept for years, almost never read | after a restore, hours |
Going down the table, storage gets cheaper and reading gets dearer or slower. The colder classes also have a minimum storage duration: 30 days for the IA classes, 90 for Glacier, 180 for Deep Archive. Delete sooner and you pay for the minimum anyway.
Choosing a class
Ask how often the data will be read, and what losing a zone would cost. Product photos: Standard. Last quarter's reports: Standard-IA. Seven years of tax records: Deep Archive.
aws s3 cp report.csv s3://market-docs-1tcyl26/reports/report.csv --storage-class STANDARD_IA--storage-class sets the class at upload. Without it, the class is STANDARD.
aws s3api head-object --bucket market-docs-1tcyl26 --key reports/report.csv --query StorageClasshead-object reports the class of an object (it leaves the field out for STANDARD). The next lesson changes classes automatically as objects age.