Warehouses
Compute-compute separation is available in the Scale and Enterprise plans. To upgrade, visit the plans page in the cloud console.
What is compute-compute separation?
Before discussing what compute-compute separation is, it's helpful to understand what a service is in ClickHouse Cloud.
Each ClickHouse Cloud service includes:
- ClickHouse compute nodes (referred to as replicas) with dedicated CPU and memory clusters
- An endpoint (or multiple endpoints created via ClickHouse Cloud UI console) to connect to the service (for example,
https://dv2fzne24g.us-east-1.aws.clickhouse.cloud:8443) for local and third party app connections - An object storage folder where the service stores all the data and part of the metadata:
Fig. 1 - Single service in ClickHouse Cloud
Rather than having a single service, you can create multiple services that have access to the same shared storage, which allows you to dedicate resources to specific workloads without having to duplicate data. This concept is called compute-compute separation.
Compute-compute separation means that each service has its own set of replicas and an endpoint, but it uses the same object storage folder and accesses the same tables, views, etc. This means you can choose the right size compute for your workload. Some of your workloads may be satisfied with only one small-size replica, and others may require full high-availability (HA) and hundreds of gigs of memory on multiple replicas.
Compute-compute separation also allows you to separate read operations from write operations so they don't interfere with each other:
Fig. 2 - Compute separation in ClickHouse Cloud
What is a warehouse?
In ClickHouse Cloud, a warehouse is a set of services that share the same data. Each warehouse has a primary service (the service created first) and one or more secondary services. For example, in the screenshot below, you can see a warehouse "DWH Prod" consisting of two services:
- Primary service
DWH Prod - Secondary service
DWH Prod Subservice
Fig. 3 - Warehouse example
All services in a warehouse share the same:
- Region (for example, us-east1)
- Cloud service provider (AWS, GCP or Azure)
- ClickHouse database version
- ClickHouse Keeper (for managing replicas)
Access controls
Database credentials
Because all services in a warehouse share the same set of tables, they also share access controls across services. This means that all database users that are created in Service 1 will also be able to use Service 2 with the same permissions (grants for tables, views, etc), and vice versa. A different endpoint is used for each service, but the same username and password is used across all services. In other words, users are shared across services that work with the same storage as shown in the figure below:
Fig. 4 - User Alice was created in Service 1, but she can use the same credentials to access all services that share same data
Network access control
To restrict access to specific services by other applications or ad-hoc users, you can apply network restrictions. To do so, navigate to Settings in the service tab of the particular service you wish to restrict access to in ClickHouse Cloud console).
IP filtering settings can be applied to each service separately, which means you can control which application can access which service. This allows you to restrict users from using specific services.
In the example below, Alice is restricted from accessing service 2 in the warehouse:
Fig. 5 - Alice is restricted from accessing service 2 because of network access control settings
ClickHouse roles and grants can also be applied to control access to the data when users are connecting as an individual rather than the default user.
Read vs read-write services
Services can be one of:
- read-write
- Can both read and write data to ClickHouse
- Performs background merge operations (e.g., merging parts after data inserts), which consume CPU and memory
- Can export data externally
- read-only
- Can only read data; it cannot write or modify data in ClickHouse
- Does not perform background merge operations, so its resources are fully dedicated to read queries
- Can still export data externally (e.g., via table functions), but cannot change data inside ClickHouse
- Idles without delay, unlike read-write services which may be kept awake by background merges.
Sometimes you want to isolate critical read workloads from write/merge overhead by making a service read only. You can do so for the second service and any additional services you create, however the first service will always be read-write, as shown in the figure below:
Fig. 6 - Read-write and Read-only services in a warehouse
- Read-only services currently support user management operations (CREATE, DROP, etc).
- Refreshable materialized views run only on read-write (RW) services in a warehouse.
Scaling
Each service in a warehouse can be adjusted to your workload in terms of:
- Number of nodes (replicas). The primary service (the service that was created first in the warehouse) should have 2 or more nodes. Each secondary service can have 1 or more nodes.
- Size of nodes (replicas)
- If the service should scale automatically (horizontally and vertically)
- If the service should be idled on inactivity
For more information, see the "Autoscaling" page.
Changes in clusterAllReplicas behavior
Once a warehouse has multiple services, the behavior of clusterAllReplicas() changes.
Using the default cluster name will only target replicas within the current service, not all services in the warehouse.
For example, if you call clusterAllReplicas(default, system, processes) from service 1, only processes running on service 1 are returned.
To query across all services in the warehouse, use the all_groups.default cluster name instead:
Secondary single-node services can scale vertically, while primary single-node services cannot.
Limitations
Workload isolation limitations
Some workloads can't be isolated to specific services; there are edge cases where one workload in one service will affect another service in the warehouse. These include:
-
All read-write services handle background merge operations by default. When inserting data to ClickHouse, the database at first inserts the data to some staging partitions, and then performs merges in the background. These merges can consume memory and CPU resources. When two read-write services share the same storage, they both are performing background operations. That means that there can be a situation where there is an
INSERTquery in Service 1, but the merge operation is completed by Service 2. Note that read-only services don't execute background merges, thus they don't spend their resources on this operation. Our support has the ability to turn off merges on a service. -
All read-write services are performing S3Queue table engine insert operations. When creating a S3Queue table on a read/write service, all other read/write services on the warehouse may perform reading data from S3 and writing data to the database.
-
Inserts on one read-write service can prevent another read-write service from idling if idling is enabled. There are situations where one service performs background merge operations for another service. Those background operations can prevent the second service from idling. Once the background operations are finished, the service will idled. Read-only services aren't affected.
Helpful Callouts
CREATE/RENAME/DROP DATABASEqueries could be blocked by idled/stopped services by default. If these queries are executed when the service is idled or stopped, these queries can hang. To bypass this, you can run database management queries withsettings distributed_ddl_task_timeout=0at the session or per query level.
For example:
If you manually stop a service, you will need to start it up again in order for queries to be executed.
- There is currently a soft limit of 5 services per warehouse. Contact the support team if you need more than 5 services in a single warehouse.
- Primary services cannot have only one replica While secondary services can have one replica, the primary service must have at least 2.
- Primary service idling Today, the default behavior is that the primary service cannot auto-idling. It is disabled once the secondary service is created. To enable this, contact support to enable parent service idling. Parent service auto-idling will be enabled by default in Q2 2026 (existing services will have access to the feature, new services will have it enabled by default).
Pricing
Compute prices are the same for all services in a warehouse (primary and secondary). Storage is billed only once - it is included in the first (original) service.
Please refer to the pricing calculator on the pricing page, which will help estimate the cost based on your workload size and tier selection. The Usage Breakdown table will show you the breakdown of compute costs across services.
Backups
- As all services in a single warehouse share the same storage, backups are made only on the primary (initial) service. By this, the data for all services in a warehouse is backed up.
- If you restore a backup from a primary service of a warehouse, it will be restored to a completely new service, not connected to the existing warehouse. You can then add more services to the new service immediately after the restore is finished.
How to set up a warehouse
Creating a warehouse
To create a warehouse, you need to create a second service that will share the data with an existing service. This can be done by clicking the plus sign on any of the existing services:
Fig. 7 - Click the plus sign to create a new service in a warehouse
On the service creation screen, the original service will be selected in the dropdown as the source for the data of the new service. Once created, these two services will form a warehouse.
Renaming a warehouse
There are two ways to rename a warehouse:
- You can select "Sort by warehouse" on the services page in the top right corner, and then click the pencil icon near the warehouse name
- You can click the warehouse name on any of the services and rename the warehouse there
Deleting a warehouse
Deleting a warehouse means deleting all the compute services and the data (tables, views, users, etc.). This action can't be undone. You can only delete a warehouse by deleting the first service created. To do this:
- Delete all the services that were created in addition to the service that was created first;
- Delete the first service (warning: all warehouse's data will be deleted on this step).