|
| 1 | +# Object storage tiers |
| 2 | + |
| 3 | +Tigris offers object storage tiers to optimize storage costs based on the access |
| 4 | +patterns of your data. There are three storage tiers available: |
| 5 | + |
| 6 | +- Standard |
| 7 | +- Infrequent Access |
| 8 | +- Archive |
| 9 | + |
| 10 | +## Standard tier |
| 11 | + |
| 12 | +The default storage class. It provides high durability, availability, and |
| 13 | +performance for frequently accessed data. |
| 14 | + |
| 15 | +## Infrequent Access tier |
| 16 | + |
| 17 | +Lower-cost storage for data that is accessed less frequently but requires rapid |
| 18 | +access when needed. |
| 19 | + |
| 20 | +## Archive tier |
| 21 | + |
| 22 | +Low-cost storage for data archiving. Long-term data archiving with infrequent |
| 23 | +access. The data is not immediately available for access and requires retrieval |
| 24 | +before it can be accessed. Retrieval times is about 1 hour. |
| 25 | + |
| 26 | +## Setting object tier |
| 27 | + |
| 28 | +Object tier can be set at the object creation time. The default object tier is |
| 29 | +Standard. To set the object tier, use the `--storage-class` flag with the |
| 30 | +`put-object` AWS CLI or corresponding field of PutObject, CreateMultipartUpload |
| 31 | +SDK APIs input. REST API users can set the `x-amz-storage-class` header. |
| 32 | + |
| 33 | +Tigris accepts S3 compatible storage classes: |
| 34 | + |
| 35 | +- STANDARD - for standard |
| 36 | +- STANDARD_IA - for infrequent access |
| 37 | +- GLACIER - for archive |
| 38 | + |
| 39 | +If the object storage class is not specified, it would be placed to the tier |
| 40 | +specified in the |
| 41 | +[bucket configuration](../buckets/create-bucket.md#setting-bucket-tier) during |
| 42 | +bucket creation time. |
| 43 | + |
| 44 | +### Example with AWS CLI |
| 45 | + |
| 46 | +```bash |
| 47 | +aws s3api put-object --bucket my-bucket --key my-object.txt --body bar.txt --storage-class STANDARD_IA |
| 48 | +``` |
| 49 | + |
| 50 | +### Example with REST API |
| 51 | + |
| 52 | +```bash |
| 53 | +PUT |
| 54 | +/my-bucket/my-object.txt |
| 55 | + |
| 56 | +host:idev-storage.fly.tigris.dev |
| 57 | +x-amz-storage-class:STANDARD_IA |
| 58 | +... |
| 59 | +``` |
| 60 | + |
| 61 | +## Restoring objects from Archive tier |
| 62 | + |
| 63 | +Objects written to the Archive storage class are not immediately available for |
| 64 | +access. Get requests for objects in the Archive storage class will return 403 |
| 65 | +(InvalidObjectState) error. To restore objects from the Archive storage class, |
| 66 | +initiate a restore request. |
| 67 | + |
| 68 | +### Initiate restore request |
| 69 | + |
| 70 | +```bash |
| 71 | +aws s3api restore-object --bucket my-bucket --key 'my-archive-object.txt' --restore-request Days=3 |
| 72 | +``` |
| 73 | + |
| 74 | +The `Days` parameter specifies the number of days the restored object will be |
| 75 | +available for access. After the specified number of days, the object will be |
| 76 | +moved back to the Archive storage class. |
| 77 | + |
| 78 | +### Check restore status |
| 79 | + |
| 80 | +```bash |
| 81 | +aws s3api head-object --bucket my-bucket --key 'my-archive-object.txt' |
| 82 | +``` |
| 83 | + |
| 84 | +Ongoing restore requests will have the `Restore: ongoing-request="true"` header |
| 85 | +in the response. Once the restore is complete, the `Restore` header will contain |
| 86 | +the expiry date when the object will be moved back to the Archive storage class: |
| 87 | + |
| 88 | +```bash |
| 89 | +{ |
| 90 | + "Restore": "ongoing-request=\"false\" expiry-date=\"Fri, 01 Nov 2024 02:00:00 GMT\"", |
| 91 | + "StorageClass": "GLACIER" |
| 92 | +} |
| 93 | +``` |
0 commit comments