2021-06-05 06:46:30 +00:00
2021-06-10 10:49:35 +00:00
# [experimental] Replicated {#replicated}
2021-06-05 06:46:30 +00:00
Supports replication of metadata via DDL log being written to ZooKeeper and executed on all of the replicas for a given database.
2021-06-10 10:51:58 +00:00
One Clickhouse server can have multiple replicated databases running and updating at the same time. But there can't be multiple replicas of the same replicated database.
2021-06-05 06:46:30 +00:00
## Creating a Database {#creating-a-database}
``` sql
2021-06-10 10:41:46 +00:00
CREATE DATABASE testdb ENGINE = Replicated('zoo_path', 'shard_name', 'replica_name') [SETTINGS ...]
2021-06-05 06:46:30 +00:00
```
**Engine Parameters**
2021-06-05 08:10:37 +00:00
- `zoo_path` — ZooKeeper path. The same ZooKeeper path corresponds to the same database.
2021-06-10 10:42:01 +00:00
- `shard_name` — Shard name. Database replicas are grouped into shards by `shard_name` .
- `replica_name` — Replica name. Replica names must be different for all replicas of the same shard.
2021-06-05 06:46:30 +00:00
2021-06-05 08:10:37 +00:00
Using this engine, creation of Replicated tables requires no ZooKeeper path and replica name parameters. Table's replica name is the same as database replica name. Table's ZooKeeper path is a concatenation of database's ZooKeeper path, `/tables/` , and `UUID` of the table.
2021-06-05 06:46:30 +00:00
## Specifics and recommendations {#specifics-and-recommendations}
Algorithms
Specifics of read and write processes
Examples of tasks
Recommendations for usage
Specifics of data storage
## Usage Example {#usage-example}
The example must show usage and use cases. The following text contains the recommended parts of this section.
Input table:
``` text
```
Query:
``` sql
```
Result:
``` text
```
Follow up with any text to clarify the example.
**See Also**
2021-06-10 10:41:46 +00:00
- [link ](# )