Skip to main content

ClickHouse® Node Groups

A ClickHouse® managed database cluster consists of node groups:

You can create a cluster from at least one shard with one node.

Shard

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

In managed 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 contain no more than ten shards.

To simplify working with data, shards can be grouped, and tables can be placed in the required group. For more information, see the Manage shard groups guide.

Replication

During replication, data is duplicated across all nodes of a shard. If one of the nodes in a shard fails, the data in that shard remains accessible.

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 only available 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 start sharding in a cluster, create a distributed table. For more information about distributed tables, see the Distributed table engine guide in the ClickHouse® documentation.

Shard weight

Each shard can have a weight—a portion of data it will receive when distributed across shards. Data is distributed in proportion 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 are 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 execution of distributed DDL queries. For more information about ClickHouse® Keeper, see the ClickHouse® Keeper guide in the ClickHouse® documentation.

The ClickHouse® Keeper node group is required for all cluster configurations except single-node. 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 creating the cluster.

The 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 — for more information, see the Scale ClickHouse® cluster guide.

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