Object Storage

  • Object Storage > User Guide > developer's guide > Manage storage > Life cycle management

    Life cycle management

    Last updated on: 2024-08-12 15:33:34

    You can implement life cycle management of all objects or specific prefixes (one or more rules can be configured) in the storage space through the Qiniu developer platform, and set life cycle rules for conversion Low-frequency storage , transfer Intelligent Tiered Storage , transfer Archive direct read storage , transfer archival storage , transfer Deep archive storage Or delete files.

    Application scenarios

    • It can be applied to the following typical scenarios:
      • For files with changing access cycles: frequently accessed for a period of time, but rarely or probably no longer accessed after a certain period of time. These documents need to be converted from standard storage to low-frequency storage, intelligent tiered storage, archive direct read storage, archive storage, deep archive storage or deletion after a certain period of time.
      • For log files that are regularly retained: log files uploaded periodically may only be retained for a week or a month. These files need to be deleted after expiration.
      • One time or regular deletion of a large number of files in the space: configure a lifecycle management rule in the space, set a regular deletion of all or a certain type of files, and avoid massive deletion.
    • For the objects in the above scenarios, you can define the life cycle management rules used to identify these objects, and implement the life cycle management of objects through these rules.

    Specific description

    Life cycle rules usually contain two key elements:

    • Policy: objects matched by lifecycle rules.
      • Configure by prefix: specify the object name prefix to match the constrained object, and the object matching the prefix will be affected by the rule. Rules are matched by the longest prefix. Prefix rules take precedence over global rules. Each uploaded file can match at most one rule.
      • Configure to the entire space: specifies that if the lifecycle management rules are configured to the entire space, all objects in the space will be affected by the rules.
    • Time: set the corresponding time when objects are converted into categories and deleted after expiration.
      You can specify how many days after an object is converted to low-frequency storage, intelligent tiered storage, archive direct read storage, archive storage, deep archive storage, or expired and automatically deleted by rules.
      • To low-frequency storage: After setting the storage object x (it is recommended that x ≥ 60), it will be automatically converted to low-frequency storage type.
      • Moving to intelligent tiered storage: After setting the storage object x (it is recommended that the access mode is not fixed), it will be automatically converted to the intelligent tiered storage storage type
      • To archive direct read storage: After setting the storage object x (x ≥ 90 is recommended), it will be automatically converted to archive direct read storage type.
      • To archive storage: After setting the storage object x (x ≥ 180 is recommended), it will be automatically converted to archive storage type.
      • To deep archive storage: After setting the storage object x (x ≥ 240 is recommended), it will be automatically converted to the deep archive storage type.
      • Delete file: You can set the storage object to be deleted after x (x ≥ 450 is recommended).
        The time setting has the following constraints:
      • The set time is full days and at least 1 day.
      • When setting multiple conversions: The days setting must meet the following conditions: transfer to low-frequency storage<transfer to intelligent tiered storage<transfer to archive direct read storage<transfer to archive storage<transfer to deep archive storage<delete files.
      • The minimum storage time of low-frequency storage is 30 days, the minimum storage time of archive direct read storage is 60 days, the minimum storage time of archive storage is 60 days, and the minimum storage time of deep archive is 180 days. If the storage time of an object under the life cycle management rules is less than the minimum storage time, you need to make up for the storage cost of the remaining days. Please set the time reasonably according to the business situation.
    • instructions:
      • Lifecycle rules only After creating or modifying rules In space The newly uploaded object takes effect , files that have been stored in the space or marked with lifecycle rules before rule creation or modification will not change with the new lifecycle rules.
      • When an object with the same name is overwritten and uploaded in the space, the newly uploaded object will be given the latest life cycle rules.
      • For objects that have executed lifecycle rules, currently only the set rules can be modified by modifying the object lifecycle API. The life cycle rules assigned to a single object are superior to those set in the space.
      • Life cycle rules The order of entry into force is irreversible , cannot convert archive direct read storage to low-frequency storage, cannot convert archive storage to low-frequency storage or archive direct read storage, cannot convert deep archive storage to low-frequency storage or archive direct read storage, cannot restore deleted files.
      • The expiration time will be displayed in the document details for the object assigned with the deletion rule.
      • For other usage problems, see FAQ.

    Operation mode

    Kodo supports setting lifecycle management through the console, or performing lifecycle related operations through APIs.

    Supported operation modes Reference Documents
    Console Set Lifecycle
    API Lifecycle Modify file lifecycle
    DeleteAfterDays Modify file expiration deletion time

    common problem

    1. How is the start time of conversion to low-frequency storage, to intelligent tiered storage, to archive direct read storage, to archive storage, to deep archive storage, and to delete files calculated?
      Qiniu adds the upload time of the object to the set number of days, and the obtained time enters the midnight of the next day (CST: China Standard Time), so as to get the start time of the object operation. For example, if an object is uploaded at 10:00 a.m. CST on January 1, 2015 and is deleted three days later, the file will be deleted on the same day after 00:00 CST on January 5, 2015.

    2. The newly uploaded files in the space equipped with life cycle rules will be given corresponding life cycle rules. How to modify the life cycle rules assigned to files marked with specific life cycle rules in the space?
      Currently, only the API interface is supported to change the life cycle rules set on the target file. For example, a standard storage file has a life cycle rule of 60 days to low-frequency storage, 90 days to archive storage, 180 days to deep archive storage, and 360 days to delete. After calling the lifecycle interface, you can redefine the automatic low-frequency storage time of the file to 70 days The storage time for archiving is changed to 90 days, the storage time for deep archiving is changed to 200 days, and the deletion time is changed to 400 days; You can also cancel the set rules.
      Note: Redefining the life cycle rules of the current space through the console has no effect on the files with the original rules, and the new rules only take effect on the newly uploaded files.

    3. Take the initiative to make changes to files with effective lifecycle rules. Will the lifecycle rules continue to take effect?
      Unless a file is deleted, its associated lifecycle rules will continue to take effect. Example:
      A standard storage file has been equipped with a life cycle rule of 60 days to low-frequency storage, 90 days to archive storage, and 360 days to delete;
      If you manually change the storage type of a file that has been automatically converted to low-frequency storage to standard storage at 70 days, the life cycle rules that are still available at 90 days will be converted to archive storage and deleted 360 days later.
      If a file that has been automatically converted to low-frequency storage is deleted manually in 70 days, the rule will become invalid.
      If the file is edited, overwritten and updated at 50 days, that is, the original file is deleted, then its associated life cycle rules will become invalid; The new file will be reassigned to the currently set lifecycle rules.

    4. Take the initiative to modify the storage type of files that have completed the life cycle rules. Do the original life cycle rules still take effect?
      Not effective. If the file has been executed according to the original lifecycle rules, the original lifecycle rules have ended and are no longer effective. Example:
      After the file has been transferred to the deep archive storage type according to the life cycle rules, manually change the storage type to archive storage, then the file will not execute the original life cycle rules and will not be transferred to the deep archive storage later.

    Will the above help you?
  •  Qvm free helper
     Close