Cold data refers to data in certain database tables that rarely changes and is read infrequently. To reduce costs, you can use cold data archiving to move this data to the low-cost Object Storage Service (OSS), which lowers your data storage expenses.
How It Works
PolarDB for MySQL supports archiving data in CSV or ORC format. Details follow.
You can archive data manually or automatically. Archived data becomes CSV or ORC files stored across multiple files in OSS. PolarDB storage space automatically deletes the archived data, reducing your storage capacity and associated storage fees. Cluster nodes access the archived data over Alibaba Cloud’s internal network. For more information, see Manually archive cold data and Automatically archive cold data.
Archive partitioned tables If your minor engine version is less than 8.0.2.2.33, go to the Quota Center, locate the quota name using the Quota ID polardb_mysql_hybrid_partition, and click Request in the corresponding Actions column to enable this feature.
Format Comparison
Compare the formats below to choose the best one for your cold data archiving needs.
Archiving standard tables, OSS external tables, and partitioned tables has specific limits. Review these carefully before archiving to avoid business impact.
After archiving, cold data is stored in the system-default Object Storage Service (OSS), not your own OSS bucket. Currently, you can only view archived data lists in the PolarDB console.
Partitioned table archiving options:
Partitioned Table Archiving: Archives a partition of a partitioned table in place. The data remains in the original table, but the storage medium for that partition changes from PolarDB (hot storage) to OSS (cold storage), resulting in a hybrid partitioned table that contains both hot and cold partitions.
Archive a partitioned table to an OSS external table: Move one partition’s data out of the original table into a new, independent OSS external table. The original table loses that partition.
Comparison item | CSV | ORC | X-Engine |
Open-source format | Yes | Yes | No |
Archiving method |
| Manual archiving: |
|
Archiving speed | Fast Note Only single-threaded archiving is supported. | Slow Note Only single-threaded archiving is supported. | Fast Note Data archives to PolarDB storage space. |
Query speed |
Note Supports both single-threaded and multi-threaded data reads. |
Note Only single-threaded data reads are supported. |
|
Transaction support | No | No | Yes |
Index support | No | No | Yes |
How to modify archived data | Archived tables on OSS are read-only. To modify them, first import the OSS data back to PolarDB storage space. | You can run DML operations on archived tables. | |
Storage space used | Same as a table in the InnoDB engine without indexes. | For the same data volume, uses 45% of the storage space required by CSV files. | Compresses storage space to 10%–50% of the InnoDB engine’s usage. Exact compression depends on data characteristics. |
Backup and restore | Not supported. Note
| Supported. | |
Impact after archiving |
|
| After archiving, you can query archived data without changing how you access the table. |
Scenarios
Archive to CSV format
If your product edition is Cluster Edition, your Milvus version must be one of the following:
MySQL 8.0.1, revision 8.0.1.1.47 or later.
MySQL 8.0.2, revision 8.0.2.2.10 or later.
If your product edition is Multi-master Cluster (Limitless) Edition, your Milvus version must be 8.0.1.0.13 or later.
Archive to ORC format
If your product edition is Cluster Edition, your revision must be 8.0.2.2.30 or later.
If your product edition is Multi-master Cluster (Limitless) Edition, your revision must be 8.0.2.2.30 or later.
Archive to X-Engine format
Archive a standard table:
MySQL 8.0.1, revision 8.0.1.1.31 or later.
MySQL 8.0.2, revision 8.0.2.2.12 or later.
Archive a partitioned table: MySQL 8.0.2, revision 8.0.2.2.12 or later.
Archive to X-Engine column-oriented table: MySQL 8.0.2, revision 8.0.2.2.33 or later.
Pricing
You pay for cold data based on its storage capacity in OSS. Pricing details follow.
The Chinese mainland | China (Hong Kong) and other regions |
USD 0.0000325 per GB-hour | USD 0.0000455 per GB-hour |
For example, if you archive 100 GB of cold data for a cluster in the Chinese mainland, the hourly fee is 100 GB × USD 0.0000325 per GB-hour = USD 0.00325 per hour.
For more information about how to view the amount of archived cold data, see View cold data archiving information.
How to Use
For more information, see Usage instructions.