Updated on 2024-02-02 GMT+08:00

Configuring Metadata Lifecycle

  • You can specify data deletion policies on the LakeFormation console to improve system flexibility and delete invalid data in a timely manner, saving space and cutting costs.
  • This configuration applies to all instances that use the same OBS parallel file system. Changing the configuration for one instance may result in overwriting the configurations of other instances.

Procedure

  1. Log in to the LakeFormation console.
  2. In the upper left corner, click and choose Analytics > LakeFormation to access the LakeFormation console.
  3. Select the LakeFormation instance to be operated from the drop-down list on the left and choose Metadata > Lifecycle in the navigation pane.
  4. Configure the metadata and data lifecycle based on the site requirements.

    Table 1 Parameters of metadata and data lifecycle configuration

    Parameter

    Description

    Data Deletion Method

    Select a data deletion method.

    • Delete directly: The system marks the metadata for deletion when you delete the data stored in OBS. This will result in the direct physical deletion of the data, which cannot be recovered.
    • Move to recycle bin: The system marks the metadata for deletion when you delete the data. This will result in the data being moved to the recycle bin directory (lake-formation-trash-dir/table_id).

    Delete Data After (Days)

    Deleted data expiration date. The value ranges from 1 to 30 or –1.

    This parameter cannot be configured if Delete directly is selected.

    • After the data is deleted, the system will automatically delete expired data based on the number of days you set.
    • If you do not want the system to automatically delete expired data, set this parameter to –1.
    • If the value of this parameter is changed after the data is deleted,the change will take effect after a certain period of time. After the system periodically synchronizes rules, data that was deleted before the change will also be subject to the new expiration period.
    • The value of Delete Data After (Days) should be no bigger than that of Delete Metadata After (Days).

    Delete Metadata After (Days)

    The value ranges from 1 to 30.

    • After the metadata is deleted, the system will automatically delete expired metadata based on the number of days you set.
    • If you change the number of days, metadata that was deleted before the change will also be subject to the new expiration period.
    • The value of Delete Data After (Days) should be no bigger than that of Delete Metadata After (Days).

  5. Click Submit.

    After the configuration is complete, the system will create a lifecycle rule named "lakeformation_trash_lifecycle" for the OBS bucket you are using in the OBS service. If you have already created a lifecycle rule for the entire file system, the system will not create this rule. Data in the recycle bin directory will be deleted based on the lifecycle rule you created for the entire file system in OBS.