Managed Service for ClickHouse lets you use network and local storage for database clusters. Network storage is based on network blocks, which are virtual disks in the Yandex.Cloud infrastructure. Local storage is organized on disks that are physically located in the database host servers.
When creating a cluster, you can choose between the following storage types:
- Standard network storage (
network-hdd): The cheapest option for servers with relaxed read/write performance requirements.
- Fast network storage (
network-ssd): A middle-ground solution. It's slower than local storage, but unlike local disks, it ensures data integrity if Yandex.Cloud hardware goes down.
- Fast local storage (
local-ssd): The fastest disks. The size of local storage can only be incremented by 100 GB.
- Hybrid storage is a win-win solution. Frequently used "hot" data is stored on network storage disks, while rarely used "cold" data is stored in Yandex Object Storage object storage.
Local storage features
Local storage doesn't provide fault tolerance for data storage and affects the overall pricing for the cluster:
- Local storage doesn't provide fault tolerance for a single-host cluster: if a local disk fails, the data is permanently lost. Therefore, when creating a new Managed Service for ClickHouse cluster using local storage, a 2-host fail-safe configuration is automatically set up.
- You are charged for a cluster with local storage even if it's stopped. Read more in the pricing policy.
At the Preview stage, you can only use this type of storage in clusters with network storage and fault tolerance disabled. These restrictions are removed at the General Availability stage.
Hybrid storage provides fault tolerance for data storage and allows you to manage data placement for MergeTree tables: the data is automatically moved from local or network storage to Object Storage when it becomes outdated.
To start using hybrid storage, you only need to create a cluster of the appropriate type with ClickHouse version 21.1 or higher. You don't need to configure object storage. For an example, see Using hybrid storage.
Cold data can be transferred to Object Storage only for tables on the MergeTree engine. Data from other tables is stored as usual — on local or network storage.
When inserting into a MergeTree table, one of two behaviors is possible:
Data is placed on local or network storage in the cluster for fast inserts. Then, when the TTL value (lifetime) expires, such rows are moved in the background to Object Storage.
You can configure moving expired rows to Object Storage and set TTL when creating a table or later. For an example of TTL use, see Using hybrid storage.
Data is placed directly in object storage if local or network storage is full. In this case, the inserting may take longer.