[Yandex Cloud documentation](../../index.md) > [Yandex Managed Service for ClickHouse®](../index.md) > Concepts > Resource relationships

# Resource relationships in Managed Service for ClickHouse®


The main entity Managed Service for ClickHouse® operates is a database _cluster_.

Each cluster consists of one or multiple _database hosts_, which are virtual machines with ClickHouse® DBMS servers deployed. Cluster hosts may reside in different availability zones and even different availability regions. You can learn more about the Yandex Cloud availability zones in the [Platform overview](../../overview/concepts/geo-scope.md).

A cluster of several ClickHouse® hosts is natively [highly available](high-availability.md) because ClickHouse® hosts can step in for one another as the cluster’s primary [replica](replication.md). To manage replication and query distribution across ClickHouse® hosts, you can use a coordination service, ClickHouse® Keeper or ZooKeeper. Depending on the selected tool, the cluster will consist of:

* Only ClickHouse® hosts with ClickHouse® Keeper support

* ClickHouse® hosts and individual ClickHouse® Keeper hosts

* ClickHouse® hosts and individual ZooKeeper hosts


The minimum number of ClickHouse® hosts per cluster depends on the following:
    
  * [Storage type](storage.md):

    * At least three hosts for non-replicated SSDs (`network-ssd-nonreplicated`).

    * At least two hosts for local SSDs (`local-ssd`).

    * At least one host for the following disk types:

      * Network HDDs (`network-hdd`).
      * Network SSDs (`network-ssd`).      * Ultra high-speed network SSDs with three replicas (`network-ssd-io-m3`).

  * Cluster sharding. When sharding is enabled, you need to multiply the minimum number of hosts for the selected disk type by the number of shards.

    For more information on the features and limitations of sharding in ClickHouse®, see [this article](sharding.md).


A single ClickHouse® host cluster does not provide [high availability](high-availability.md).

To make an existing cluster with a single ClickHouse® host highly available:

1. Add at least three [ClickHouse® Keeper](../operations/ck-hosts.md#add-ck) or [ZooKeeper](../operations/zk-hosts.md#add-zk) hosts to the cluster to manage replication.
1. [Add ClickHouse® hosts to your cluster](../operations/hosts.md#add-host) to distribute replicas among them.

This will make your cluster highly available.

When creating a cluster, specify:
* _Host class_: VM template for deploying cluster hosts. For a list of available host classes and their specs, see [Host classes](instance-types.md).

* _Environment_: Environment where the cluster will be deployed:
   * `PRODUCTION`: For stable versions of your applications.
   * `PRESTABLE`: For testing purposes. The prestable environment is similar to the production environment and likewise covered by an SLA, but it is the first to get new features, improvements, and bug fixes. In the prestable environment, you can test new versions for compatibility with your application.

You should also specify the host class when creating a [shard](sharding.md).


You can access a cluster created in a folder from any VM in the same cloud network. For more information on how the network works, see [this Virtual Private Cloud guide](../../vpc/index.md).


{% note alert %}

The service can automatically access the system and diagnostic information of your databases to render monitoring charts and maintain your cluster health. It never accesses or uses the data you entered into the database manually.

{% endnote %}

Be mindful of what is managed by the service and what, by the Yandex Cloud customer. Understanding these zones of control makes you an efficient user of cloud resources and helps avoid potential database-related issues. For more information, see [Zones of control between managed database (MDB) service users and Yandex Cloud](../../overview/concepts/mdb-responsibilities.md).

_ClickHouse® is a registered trademark of [ClickHouse, Inc](https://clickhouse.com)._