Amazon S3 storage classes&lifecycle configuration

 Each object in Amazon S3 has a storage class associated with it. 

Storage classes for frequently accessed objects

• S3 Standard

• S3 Express One Zone

S3 Express One Zone is the first S3 storage class where you can select a single Availability Zone with the option to co-locate your object storage with your compute resources, which provides the highest possible access speed. Additionally, to further increase access speed and support hundreds of thousands of requests per second, data in S3 Express One Zone storage class is stored in a new bucket type: an Amazon S3 directory bucket. Each directory bucket can support hundreds of thousands of transactions per second (TPS), irrespective of key names or access pattern.

Storage class for automatically optimizing data with changing or unknown access patterns

• S3 Intelligent-Tiering

S3 Intelligent-Tiering automatically stores objects in three access tiers:

• Frequent Access – Objects that are uploaded or transitioned to S3 Intelligent-Tiering are automatically stored in the Frequent Access tier. 

• Infrequent Access – S3 Intelligent-Tiering moves objects that have not been accessed in 30 consecutive days to the Infrequent Access tier. 

• Archive Instant Access – With S3 Intelligent-Tiering, any existing objects that have not been accessed for 90 consecutive days are automatically moved to the Archive Instant Access tier. 

In addition to these three tiers, S3 Intelligent-Tiering offers two optional archive access tiers: 

• Archive Access – S3 Intelligent-Tiering provides you with the option to activate the Archive Access tier for data that can be accessed asynchronously. After activation, the Archive Access tier automatically archives objects that have not been accessed for a minimum of 90 consecutive days. 

• Deep Archive Access – S3 Intelligent-Tiering provides you with the option to activate the Deep Archive Access tier for data that can be accessed asynchronously. After activation, the Deep Archive Access tier automatically archives objects that have not been accessed for a minimum of 180 consecutive days.

We recommend the following: 

• S3 Standard-IA – Use for your primary or only copy of data that can't be re-created. 

• S3 One Zone-IA – Use if you can re-create the data if the Availability Zone fails, and for object replicas when configuring S3 Cross-Region Replication (CRR).

Amazon S3 offers multiple S3 Glacier storage classes that are designed to provide cost-effective solutions to storing long-term data that isn't accessed often. The S3 Glacier storage classes are:

  • S3 Glacier Instant Retrieval

  • S3 Glacier Flexible Retrieval

  • S3 Glacier Deep Archive

Creating a lifecycle configuration 

An S3 Lifecycle configuration is an XML file that consists of a set of rules with predefined actions that you want Amazon S3 to perform on objects during their lifetime.

Unsupported lifecycle transitions 

Amazon S3 does not support any of the following lifecycle transitions. You can't transition from the following: 

• Any storage class to the S3 Standard storage class

存储时间指创建多少天后才可以?
STANDARD-IA:

# aws s3api get-bucket-lifecycle-configuration --bucket bucket-for-logging-1
{
    "Rules": [
        {
            "ID": "e38ff268-c38b-41f2-b569-525cbbaef132",
            "Filter": {
                "Prefix": "jgp/"
            },
            "Status": "Enabled",
            "Transitions": [
                {
                    "Days": 30,
                    "StorageClass": "STANDARD_IA"
                }
            ]
        }
    ]
}
假设您的桶未启用版本控制,且希望在创建30天后将对象名前缀为“documents/”的对象转为低频访问存储对象,创建60天后转为归档存储对象,创建1年之后永久删除。为此,您可以向桶附加以下生命周期配置。该生命周期配置定义的规则包含两个操作(Transition和Expiration),该规则应用于键前缀为“documents”(在Prefix元素中指定)的对象。
<LifecycleConfiguration> 
    <Rule> 
        <ID>sample-rule</ID> 
        <Prefix>documents/</Prefix> 
        <Status>Enabled</Status> 
        <Expiration> 
             <Days>365</Days> 
        </Expiration> 
        <Transition>  
             <Days>30</Days> 
             <StorageClass>WARM</StorageClass>
        </Transition>  
        <Transition>  
             <Days>60</Days>  
             <StorageClass>COLD</StorageClass>  
        </Transition> 
    </Rule> 
</LifecycleConfiguration>
天数指创建多少天后,不是指要在该类型保持的天数

Q: What does "Days' in Transition action must be greater than or equal to 30 for storageClass 'STANDARD_IA' " mean?

A: The message you're encountering is related to Amazon S3 lifecycle rules and storage classes. It indicates a specific requirement for transitioning objects to the STANDARD_IA storage class.

Here's a breakdown of the message:

  • Days' in Transition action: This refers to the number of days that an object must remain in its current storage class before it can be transitioned to the STANDARD_IA class.
  • must be greater than or equal to 30: This specifies the minimum number of days required. In this case, objects need to be in a different storage class for at least 30 days before being transitioned to STANDARD_IA.
  • storageClass 'STANDARD_IA': This refers to the specific Amazon S3 storage class where this rule applies. STANDARD_IA is a lower-cost storage class designed for infrequently accessed data.

In simpler terms, Amazon S3 enforces a 30-day waiting period before you can move objects to the STANDARD_IA storage class. This ensures that you don't accidentally transition objects you might still need to access quickly.

Here are some additional points to consider:

  • This rule only applies when transitioning objects to STANDARD_IA storage class. There are no minimum waiting periods for transitioning to other S3 storage classes like Glacier.
  • You can set lifecycle rules to automatically manage object transitions based on criteria like time since creation or last access.

If you're encountering this error message, it means your S3 lifecycle rule is trying to transition objects to STANDARD_IA before they meet the 30-day minimum requirement. You'll need to adjust your rule to either increase the 'Days' in Transition value to 30 or more, or transition the objects to a different storage class that doesn't have this restriction.





评论

此博客中的热门博文

码率单位

Process vs. Thread

日志文件系统