Help Center/ TaurusDB/ Best Practices/ Enabling Cold and Hot Data Separation
Updated on 2026-02-12 GMT+08:00

Enabling Cold and Hot Data Separation

Scenarios

This practice covers two scenarios with corresponding tutorials:

  • Cold and hot data separation for a partitioned table: Periodically Archiving Cold Data in a Partitioned Table Using a Shell Script
    You can use shell scripts on Huawei Cloud Elastic Cloud Servers (ECSs) to schedule regular cold data archiving by partition. You are advised to use INTERVAL RANGE to automatically expand partitions and, in conjunction with automatic cold table configuration, archive data from less frequently used partitions to OBS.

    For tables without partitions, you can configure cold tables on the TaurusDB console or using SQL statements. For details, see Configuring a Cold Table.

  • Cold and hot data separation for the entire database: Archiving Cold Data in Each Table Using a Stored Procedure

    You can connect to a TaurusDB instance via DAS and use a stored procedure to archive each table's cold data in sequence. To avoid a long archiving time, it is recommended that the entire database contain no more than 50 tables.

    This method requires that the kernel version be 2.0.72.251200 or later. For details about how to check the kernel version, see How Can I Check the Version of a TaurusDB Instance?

Precautions

  • The tables to be archived must meet the constraints. For details, see Archiving a Cold Table.
  • The following code example is for reference only. You can test and verify it based on the service scenario.

Periodically Archiving Cold Data in a Partitioned Table Using a Shell Script

Archiving Cold Data in Each Table Using a Stored Procedure