Transfer data between storage devices in Aiven for ClickHouse®’s tiered storage#
Important
Aiven for ClickHouse® tiered storage is a limited availability feature. If you’re interested in trying out this feature, contact the sales team at sales@Aiven.io.
Check out this article for instructions on transferring data from and to SSD for an Aiven for ClickHouse® service.
About moving data between storage devices#
After enabling the tiered storage feature, you can move your data from SSD to object storage. Next, you may want to size down your SSD by selecting a service plan with less SSD capacity. Later, you can move your data from object storage back to your SSD if needed. Both operations can be performed using SQL statements against your tables directly.
Prerequisites#
Aiven organization
Tiered storage feature enabled at project level
Command line tool (ClickHouse client)
Transfer data from SSD to object storage#
If you enable the tiered storage feature on your table, by default your data is moved from SSD to object storage as soon as the SSD reaches 80% of its capacity. You can also configure your tiered storage so that data is moved to object storage at a specific time.
Connect to your Aiven for ClickHouse service using, for example, the ClickHouse client (CLI).
Run the following query:
ALTER TABLE database-name.tablename MODIFY SETTING storage_policy = 'tiered'
Result
Now, with the tiered storage feature enabled, your data is moved from SSD to object storage when the SSD reaches 80% of its capacity.
Transfer data from object storage to SSD#
Use the MOVE statement MOVE PARTITION|PART to transfer data to your SSD.
Connect to your Aiven for ClickHouse service using, for example, the ClickHouse client (CLI).
Select a database for operations you intend to perform.
USE database-name
Run the following query:
ALTER TABLE table_name MOVE PARTITION partition_expr TO VOLUME 'default'
Result
Your data has been moved to the SSD.