Skip to main content

ClickHouse® Node Groups

Last update:

A ClickHouse® cloud database cluster consists of node groups:

You can create a cluster with a minimum of one shard with one node.

Shard

A shard is a group of replica nodes that stores data, processes requests, and participates in replication and sharding. Read more about shards in the Table shards and replicas ClickHouse® documentation.

In cloud ClickHouse® databases, a shard can consist of one or more nodes. The total number of nodes in a shard cannot exceed ten.

A cluster can have no more than ten shards.

To simplify data management, shards can be combined into groups and tables can be placed in the required group. Read more in the Manage shard groups guide.

Replication

During replication, data is duplicated across all nodes in the shard. If one of the nodes in a shard fails, the data in the shard will still be available.

We recommend creating fault-tolerant clusters with data replication.

Sharding

During sharding, data is split into parts and distributed across different shards. This allows for parallel request processing.

Sharding is available only if there is more than one shard in the cluster. You can specify the number of shards when creating a cluster or add shards to an existing cluster.

To enable sharding in a cluster, create a distributed table. Read more about distributed tables in the Distributed table engine ClickHouse® documentation.

Shard weight

Each shard can have a weight — the fraction of data it will receive when distributed across shards. Data is distributed proportionally to the weights of all shards in the cluster. The higher the shard weight, the more data will be written to it. Available weight values range from 0 to 65 535.

note

For example, a cluster has two shards: shard1 with a weight of 70 and shard2 with a weight of 100. The total sum of weights in the cluster is 70 + 100 = 170. shard1 will receive (70 / 170) × 100% = 41% of the data. shard2 will receive (100 / 170) × 100% = 59% of the data.

ClickHouse® Keeper

ClickHouse® Keeper is a group of nodes responsible for data consistency, replica synchronization, and executing distributed DDL queries. Read more about ClickHouse® Keeper in the ClickHouse® Keeper ClickHouse® documentation.

A ClickHouse® Keeper node group is required for all cluster configurations, except for single-node ones. This node group is added automatically when creating a cluster if it contains a shard with two or more nodes or multiple shards. You can also add ClickHouse® Keeper after cluster creation.

A ClickHouse® Keeper node group always consists of three nodes. You cannot change the number of nodes in this group. You can change the configuration of ClickHouse® Keeper — read more in the Scale ClickHouse® cluster guide.

ClickHouse® is a registered trademark of ClickHouse, Inc. https://clickhouse.com.