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 requests, and participates in replication and sharding. Read more about shards in the Table shards and replicas article 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. Read more in the Managing shard groups guide.

Replication

During replication, data is duplicated on all nodes in the shard. If one of the nodes in a shard stops working, 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 the cluster has more than one shard. 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. Read more about distributed tables in the Distributed table engine article in the ClickHouse® documentation.

Shard weight

Each shard can have a weight — the data share 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 range from 0 to 65535.

note

For example, in a cluster with 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 requests. Read more about ClickHouse® Keeper in the ClickHouse® Keeper article in the ClickHouse® documentation.

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

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 — see the Scaling a ClickHouse® cluster guide for details.

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