ClickHouse / ClickHouse/ClickHouse

`Cluster` database engine

Open
#114,411 0 comments 0 reactions 0 assignees View on GitHub
comp-database-engines feature
Dominant language
C++
Stars
49.9k
Forks
9k
Avg merge
21h 32m
Merged PRs (30d)
515

Description

A follow-up to the `Remote` database engine (https://github.com/ClickHouse/ClickHouse/issues/59304, implemented in https://github.com/ClickHouse/ClickHouse/pull/110975).

Implement a new database engine, `Cluster`. While the `Remote` database engine takes explicit addresses, the `Cluster` engine should take the name of a cluster from the server configuration — the same way the [`cluster`/`clusterAllReplicas`](https://clickhouse.com/docs/sql-reference/table-functions/cluster) table functions relate to the [`remote`](https://clickhouse.com/docs/sql-reference/table-functions/remote) table function:

```sql
CREATE DATABASE db ENGINE = Cluster('cluster_name', 'database');
```

It provides real-time access to the tables of a database on the cluster: the list of tables and their structure are fetched on demand, and every table is exposed as a `Distributed` storage over the named cluster, forwarding `SELECT` and `INSERT` queries to it.

Related: https://github.com/ClickHouse/ClickHouse/issues/59304
Related: https://github.com/ClickHouse/ClickHouse/pull/110975

Contributor guide

Open the contributing guide

Research direction

Start by reading issue 59304 and pull request 110975, which describe the related Remote database engine. Compare that behavior with the requested CREATE DATABASE db ENGINE = Cluster('cluster_name', 'database') semantics; done means the cluster-backed database exposes current table structure and forwards SELECT and INSERT queries through the named cluster.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, sql
Domain
databases, distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.