本页还没有译文
本页 30 段还没译成Español,下面显示的是英文原文。Storage classes
还没翻译译自英文(developers.cloudflare.com)本页 30 段都还没译
Storage classes allow you to trade off between the cost of storage and the cost of accessing data. Every object stored in R2 has an associated storage class.
All storage classes share the following characteristics:
- Compatible with Workers API, S3 API, and public buckets.
- 99.999999999% (eleven 9s) of annual durability.
- No minimum object size.
Available storage classes
| Storage class | Minimum storage duration | Data retrieval fees (processing) | Egress fees (data transfer to Internet) |
|---|---|---|---|
| Standard | None | None | None |
| Infrequent Access | 30 days | Yes | None |
For more information on how storage classes impact pricing, refer to Pricing.
Standard storage
Standard storage is designed for data that is accessed frequently. This is the default storage class for new R2 buckets unless otherwise specified.
Example use cases
- Website and application data
- Media content (e.g., images, video)
- Storing large datasets for analysis and processing
- AI training data
- Other workloads involving frequently accessed data
Infrequent Access storage
Infrequent Access storage is ideal for data that is accessed less frequently. This storage class offers lower storage cost compared to Standard storage, but includes retrieval fees and a 30 day minimum storage duration requirement.
Note
For objects stored in Infrequent Access storage, you will be charged for the object for the minimum storage duration even if the object was deleted, moved, or replaced before the specified duration.
Example use cases
- Long-term data archiving (for example, logs and historical records needed for compliance)
- Data backup and disaster recovery
- Long tail user-generated content
Set default storage class for buckets
By setting the default storage class for a bucket, all objects uploaded into the bucket will automatically be assigned the selected storage class unless otherwise specified. Default storage class can be changed after bucket creation in the Dashboard.
To learn more about creating R2 buckets, refer to Create new buckets.
Set storage class for objects
Specify storage class during object upload
To learn more about how to specify the storage class for new objects, refer to the Workers API and S3 API documentation.
Use object lifecycle rules to transition objects to Infrequent Access storage
Note
Once an object is stored in Infrequent Access, it cannot be transitioned to Standard Access using lifecycle policies.
To learn more about how to transition objects from Standard storage to Infrequent Access storage, refer to Object lifecycles.
Change storage class for objects
You can change the storage class of an object which is already stored in R2 using the CopyObject API.
Use the x-amz-storage-class header to change between STANDARD and STANDARD_IA.
An example of switching an object from STANDARD to STANDARD_IA using aws cli is shown below:
aws s3api copy-object \
--endpoint-url https://<ACCOUNT_ID>.r2.cloudflarestorage.com \
--bucket bucket-name \
--key path/to/object.txt \
--copy-source /bucket-name/path/to/object.txt \
--storage-class STANDARD_IA- Refer to aws CLI for more information on using
aws CLI. - Refer to object-level operations for the full list of object-level API operations with R2-compatible S3 API.