Help Center/ DataArts Lake Formation/ User Guide/ LakeFormation Metadata Management/ Managing LakeFormation Metadata Deletion Policies
Updated on 2025-07-31 GMT+08:00

Managing LakeFormation Metadata Deletion Policies

  • 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 bucket. Changing the configuration for one instance may result in overwriting the configurations of other instances.

Procedure

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

    Figure 1 Configuring the metadata lifecycle
    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, leading to the irreversible physical erasure of the data.
    • Move to recycle bin: The system marks the metadata for deletion when you delete the data, which consequently moves the data to the recycle bin directory (OBS path 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).

  4. 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.