Archive Direct Read lets you directly access objects in the Archive storage class for scenarios such as data lakes and cloud photo albums without needing to restore them first. This feature provides real-time access to extremely infrequently accessed data while maintaining low storage costs, balancing storage costs with access efficiency.
Restore-then-read vs. direct read
The following table compares data retrieval with and without Archive Direct Read enabled.
|
Item |
Default |
Direct read enabled |
|
Retrieval method |
Restore, then read |
Direct read |
|
Retrieval fee① |
Low |
High |
|
Retrieval time |
Minutes |
Milliseconds |
①For more information about retrieval fees, see OSS产品定价.
Enable Archive Direct Read
OSS console
Log on to the OSS console.
In the left-side navigation pane, click Buckets. On the Buckets page, find and click the desired bucket.
-
In the navigation pane on the left, choose Data Management > Archive Direct Read.
-
On the Real-time Access of Archive Objects page, turn on Real-time Access of Archive Objects.
-
In the message that appears, click OK.
Ossutil
Before you use ossutil, you must install it.
-
Run the following command to enable Archive Direct Read for a bucket named
examplebucket:ossutil api put-bucket-archive-direct-read --bucket examplebucket --archive-direct-read-configuration "{\"Enabled\":\"true\"}"For more information about this command, see put-bucket-archive-direct-read.
-
Run the following command to check whether Archive Direct Read is enabled for the bucket named
examplebucket:ossutil api get-bucket-archive-direct-read --bucket examplebucketFor more information about this command, see get-bucket-archive-direct-read.
API
If your application has high customization requirements, you can directly make REST API requests. This requires you to manually write code to calculate signatures. For more information, see PutBucketArchiveDirectRead and GetBucketArchiveDirectRead.
Supported read operations
After you enable Archive Direct Read for a bucket, you can perform the following read operations on objects in the Archive storage class without restoring them:
Query object access records
If you have not enabled indexing for the
archive_direct_read_sizefield in Simple Log Service, use scan mode to run the query:* and __topic__: oss_access_log and bucket: buckename | set session mode=scan; select object where archive_direct_read_size not like '-'If you have enabled indexing for the
archive_direct_read_sizefield in Simple Log Service, use index mode to run the query:* and __topic__: oss_access_log and bucket: buckename |select object where archive_direct_read_size not like '-'
Query direct read traffic
If you have not enabled indexing for the
archive_direct_read_sizefield in Simple Log Service, use scan mode to run the query:* and __topic__: oss_access_log and bucket: bucketname | set session mode=scan; select sum(cast(archive_direct_read_size as bigint)) as total_size where archive_direct_read_size != '-'If you have enabled indexing for the
archive_direct_read_sizefield in Simple Log Service, use index mode to run the query:* and __topic__: oss_access_log and bucket: bucketname | select sum(cast(archive_direct_read_size as bigint)) as total_size where archive_direct_read_size != '-'
Permissions
RAM users require the following permissions: oss:PutBucketArchiveDirectRead and oss:GetBucketArchiveDirectRead. For more information, see Grant custom permissions to a RAM user.
Limitations
-
Archive Direct Read applies only to objects in the Archive storage class. It does not apply to objects in the Cold Archive or Deep Cold Archive storage classes.
-
If a bucket has Archive Direct Read enabled, using an unrestored object from the Archive storage class as the default index or error page for static website hosting results in a 403 error. To ensure the pages are accessible, use objects in the Standard storage class for the default index and error pages.
Billing
-
After you enable Archive Direct Read for a bucket, directly reading an unrestored Archive storage class object from the bucket incurs Archive Direct Read data retrieval capacity (RetrievalDataArchiveDirect) fees. The Archive Direct Read retrieval capacity generated by a request is indicated by the value of the
archive_direct_read_sizelog field. For restored Archive storage class objects, direct reads do not incur Archive Direct Read data retrieval capacity fees. For more information, see Data processing fees. -
The billable data retrieval amount is determined by the read range specified in the request header when the HTTP connection is established. Terminating the connection prematurely does not affect the billable amount for an initiated request. For example, if you request a range of 100 MB to 200 MB but interrupt the connection after reading only 1 byte, you are still billed for the entire 100 MB to 200 MB range.
-
When you use Archive Direct Read to scale an archived image, OSS calculates the data retrieval amount based on the size of the source image, not the processed image. This means that you are billed based on the source image size even if the processing significantly reduces the size of the output image. For example, if a 1 GB source image is scaled to 100 KB, the billed data retrieval amount is 1 GB.