---
title: "ClickHouse® Node Groups"
sidebar_label: "Node Groups"
description: "Node groups that make up a ClickHouse® cluster"
sidebar_position: 7
---

import {CustomTable} from '@selectel/docux/components'
import Formbricks from '@theme/MDXComponents/Formbricks'

# ClickHouse® Node Groups

A ClickHouse® managed database cluster consists of node groups:

* [shards](#shard);
* [ClickHouse® Keeper](#clickhouse-keeper) — added automatically when [creating a cluster](/managed-databases/clickhouse/create-cluster.mdx) if it contains a shard with two or more nodes or multiple shards.

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

## Shard \{#shard}

A shard is a group of replica nodes that stores data, processes requests, and participates in [replication](#replication) and [sharding](#sharding). Read more about shards in the [Table shards and replicas](https://clickhouse.com/docs/shards) 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](/managed-databases/clickhouse/manage-shard-groups.mdx) guide.

### Replication \{#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](/managed-databases/clickhouse/cluster-fault-tolerance.mdx) with [data replication](/managed-databases/clickhouse/cluster-fault-tolerance.mdx#data-replication).

### Sharding \{#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](/managed-databases/clickhouse/create-cluster.mdx) or [add shards](/managed-databases/clickhouse/resize-cluster.mdx#add-shard) to an existing cluster.

To start sharding in a cluster, create a distributed table. Read more about distributed tables in the [Distributed table engine](https://clickhouse.com/docs/engines/table-engines/special/distributed) article in the ClickHouse® documentation.

### Shard weight \{#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}

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](https://clickhouse.com/docs/guides/sre/keeper/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](/managed-databases/clickhouse/create-cluster.mdx) if it contains a shard with two or more nodes or multiple shards. You can also [add ClickHouse® Keeper](/managed-databases/clickhouse/resize-cluster.mdx#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](/managed-databases/clickhouse/configurations.mdx#node-group-configurations) of ClickHouse® Keeper — see the [Scaling a ClickHouse® cluster](/managed-databases/clickhouse/resize-cluster.mdx) guide for details.

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

<Formbricks />
