Free audit

View Audit Scope
JusDBReplicatedMergeTree · Keeper · Insert quorum · Backups and drills

ClickHouse high availability designed so inserts and dashboards keep running when a node fails.

JusDB designs and runs highly available ClickHouse clusters: replicated tables across zones, a ClickHouse Keeper ensemble sized for the failures you plan for, insert settings chosen per table, and backups that are restored on a schedule. We test each design by stopping replicas and Keeper nodes on a copy before production depends on it.
The first 30-minute call covers your databases, current ownership, and required coverage. No production access is needed.
  • NDA before access
  • Drills on a copy first
  • Changes approved by you

clickhouse_cluster_ha

Replicas

Spread across zones

Each layer is tested by failing it on purpose, then written into the runbook.

Selected clients

  • Innoviti
  • Blitz
  • Freecharge
  • Nango
  • Recochain
  • Screen Facts
  • Nexora
  • WeCredit

ClickHouse failure modes

What fails in a ClickHouse cluster, and what each design choice covers.

High availability in ClickHouse is several separate decisions: replicas, coordination, insert confirmation, routing, and backups. Each one covers a different failure.

One replica host fails

What your users see
Other replicas of the shard keep serving reads and taking inserts, because every replica accepts writes. Distributed queries move to a healthy replica.
What the design does about it
At least two replicas per shard in different zones, internal_replication=true on the cluster, and a load_balancing policy you choose. The returning replica catches up from its peers.

One Keeper node fails

What your users see
Usually nothing visible, if the ensemble still has a majority. A three-node ensemble survives one node loss; if the failed node was the leader, Keeper requests wait briefly while a new leader is elected.
What the design does about it
Three Keeper nodes for most clusters, five where two simultaneous losses must be survivable, each on its own disk and spread across zones.

Keeper loses quorum

What your users see
Replicated tables go read-only: SELECT queries keep working, inserts and ALTERs fail. ON CLUSTER DDL stalls.
What the design does about it
Alerts on leader loss and request latency, Keeper logs and snapshots on fast dedicated disks, and a written recovery procedure (runbook) rehearsed on a copy.

A server dies holding Distributed inserts

What your users see
Rows written through a Distributed table wait on the local disk before they are sent. If that disk is lost, those rows are lost.
What the design does about it
Insert into the local replicated tables where the client can, or set distributed_foreground_insert=1 so the INSERT returns only after each shard has the data. Alert on system.distribution_queue.

A replica takes the only copy of an insert, then fails

What your users see
By default an INSERT is confirmed after one replica writes it. If that replica's disk is lost before the others fetch the part, the rows are gone.
What the design does about it
insert_quorum set to 2, or 'auto' for a majority, on tables where losing a recent batch matters, with select_sequential_consistency for readers that must see quorum writes.

A bad mutation or a DROP

What your users see
Replication copies the mistake to every replica. More replicas do not help here.
What the design does about it
Backups to object storage with tested restores, users without DROP rights on production tables, and ALTERs reviewed before they run.

ClickHouse high availability scope

Six parts of a highly available ClickHouse cluster.

We start from the failures you need to survive and the data you cannot replay, then design each layer for them. Results depend on the workload; we baseline before and measure after each approved change.

Shard and replica layout

How many shards, how many replicas per shard, and where each replica runs, decided from data size, query load, and the zone, rack, or region failures you need to survive. Replication is asynchronous and works across data centers, so a replica in a second region is possible; a quorum insert that spans regions waits on the slowest link.

  • Replica paths built from {shard} and {replica} macros, so DDL is the same on every node
  • Replicas of one shard placed in different zones or racks
ReplicatedMergeTree · remote_servers · macros
ClickHouse consulting

Keeper ensemble design

A ClickHouse Keeper ensemble sized for the failures you plan for, with its logs and snapshots on disks that ClickHouse merges do not compete for.

  • Three nodes tolerate one failure; five tolerate two
  • ZooKeeper clusters moved to Keeper in a planned stop, since the two cannot form one ensemble
clickhouse-keeper · mntr · clickhouse-keeper-converter
ZooKeeper to Keeper migration

Insert durability

Write confirmation chosen per table: one replica for high-volume logs you can replay, a quorum for data you cannot.

  • insert_quorum and insert_quorum_parallel set with their read-side trade-offs explained
  • Retries made safe by block deduplication, with the same batches resent on failure
insert_quorum · insert_deduplicate · wait_for_async_insert

Distributed tables and routing

Distributed tables that send each insert to one healthy replica per shard and each query to replicas that are not too far behind.

  • internal_replication=true for replicated tables, so the replica set handles copying
  • max_replica_delay_for_distributed_queries and load_balancing set to your read tolerance
Distributed · load_balancing · system.distribution_queue

Backups and disaster recovery

Replication protects against a lost node, not a lost table. Backups go to object storage in another region or account, and restores are tested on a schedule you agree.

  • Full and incremental BACKUP to S3, GCS, or Azure Blob Storage
  • Restore tests that compare row counts and checksums with the source
BACKUP · RESTORE · clickhouse-backup · system.backups

Failure drills

Replica, Keeper node, and zone failures rehearsed on a copy or in an agreed window, with what happened and how long recovery took written down.

  • Drills check that inserts and dashboards keep working, not only that nodes come back
  • Runbooks updated after each drill and each incident
SYSTEM STOP REPLICATION QUEUES · SYSTEM RESTORE REPLICA · runbooks

Replication and routing setup

A replicated table, its Distributed table, and the checks we run.

A simplified example with two shards and two replicas each. Real clusters add TLS, users, and storage policies, and the values come from your workload.

01 · Cluster, replicated table, Distributed table

-- config.xml (excerpt): replicas of a shard share a Keeper path
-- <remote_servers><analytics>
--   <shard><internal_replication>true</internal_replication>
--     <replica><host>ch-a1</host><port>9000</port></replica>
--     <replica><host>ch-b1</host><port>9000</port></replica>
--   </shard>
--   <shard>...ch-a2, ch-b2...</shard>
-- </analytics></remote_servers>

CREATE TABLE events_local ON CLUSTER analytics
(
    event_date Date,
    user_id    UInt64,
    event_type LowCardinality(String),
    payload    String
)
ENGINE = ReplicatedMergeTree(
    '/clickhouse/tables/{shard}/{database}/events_local',
    '{replica}')
PARTITION BY toYYYYMM(event_date)
ORDER BY (event_type, user_id, event_date);

CREATE TABLE events ON CLUSTER analytics
AS events_local
ENGINE = Distributed(analytics, currentDatabase(),
                     events_local, cityHash64(user_id));

02 · Insert settings and replica checks

-- Quorum write for data that cannot be replayed
INSERT INTO events_local
SETTINGS insert_quorum = 'auto'
VALUES (...);

-- Replicas that are read-only, behind, or missing peers
SELECT database, table, is_readonly, is_session_expired,
       absolute_delay, queue_size,
       active_replicas, total_replicas
FROM clusterAllReplicas('analytics', system.replicas)
WHERE is_readonly OR absolute_delay > 300
   OR active_replicas < total_replicas;

-- Rebuild Keeper metadata for a replica whose data is intact
-- (only after the cause is understood and the step agreed)
SYSTEM RESTORE REPLICA events_local;

ClickHouse Cloud or self-managed

Who runs availability on ClickHouse Cloud and on your own servers.

ClickHouse Cloud removes Keeper and replica placement from your list. It does not remove table design, insert behavior, or the need to check backups against your recovery targets.

Table engine
SharedMergeTree. Data lives in object storage and replicas share it.
ReplicatedMergeTree. Each replica keeps its own copy on local or attached disks.
Coordination
Run by ClickHouse for you.
A ClickHouse Keeper or ZooKeeper ensemble that your team, or JusDB under your agreement, runs.
Zones
Basic tier runs one replica in one zone. Scale and Enterprise tiers run across two or more zones, and ClickHouse describes Scale as built for deployments of two or more replicas.
Wherever you place replicas and Keeper nodes.
Backups
Daily by default, each kept for 24 hours; tiers above Basic can change the schedule. A restore creates a new service.
Your team runs BACKUP or clickhouse-backup to object storage and tests restores.
What stays yours
Table design, insert batching, deduplication, queries, users, and your own backup checks.
All of the above, plus hosts, disks, Keeper, replicas, and upgrades.

ClickHouse Cloud tier and backup details from the ClickHouse Cloud documentation, checked 27 November 2026. Tiers change; we re-check them for each service we review.

Ways to work with JusDB

A high availability project, then ongoing coverage if you want it.

Most teams start with a scoped review of the current cluster. A monthly retainer for a set number of engineering hours, or a monthly fee per database instance, HA cluster, or region; projects are scoped and quoted separately.

Review

ClickHouse HA review

We read your cluster layout, Keeper ensemble, insert settings, and backups, and write down which failures you survive today and which you do not.

Project

Build or rebuild

New replicas, a Keeper ensemble or a move off ZooKeeper, Distributed table changes, and backup jobs, each rehearsed on a copy first.

Ongoing

ClickHouse remote DBA

JusDB engineers watch replicas, Keeper, and backups, run drills, and answer incidents under the SLA response times.

Procurement and security

Ready for legal and security review.

Mutual NDA before any access, least-privilege credentials in your vault, and security controls aligned with ISO 27001 and SOC 2 Type II.
  • Mutual NDA before any access
  • Named individual accounts only
  • Read-only access by default
  • ISO 27001 & SOC 2 Type II: aligned, certification in progress
  • Mutual NDA before any access

    We sign a mutual NDA before viewing schemas, logs, slow-query captures, or cloud topology.

  • Least-privilege, named credentials

    Engineers connect through your bastion, VPN, or SSM using named accounts with read-only permissions by default.

  • Change control & approval gates

    Production DDL, parameter changes, and failovers follow your change-management workflow with rollback steps prepared first.

  • Named leadership & direct escalation

    Engagements are led by named senior database reliability engineers in India with direct Slack, Teams, and PagerDuty channels.

ClickHouse high availability FAQ

Questions about ClickHouse replication and recovery.

How replication works, Keeper or ZooKeeper, insert quorum, ClickHouse Cloud tiers, and incident response.

Still have a question?

Ask it on a scoping call. No production access needed.

Book a 30-min scoping call (opens Google Calendar in a new tab)

How does ClickHouse high availability work?

JusDB builds ClickHouse high availability from replicated tables. ReplicatedMergeTree keeps a copy of each shard on two or more servers, and ClickHouse Keeper or ZooKeeper coordinates which parts each replica must hold. Replication is asynchronous and multi-master, so any replica accepts inserts and there is no primary to promote. Distributed tables route queries and inserts to healthy replicas.

Should we use ClickHouse Keeper or ZooKeeper?

JusDB uses ClickHouse Keeper for new clusters, as the ClickHouse docs recommend. Keeper speaks the ZooKeeper client protocol, so ClickHouse servers connect to it the same way. A mixed ZooKeeper and Keeper ensemble is not possible, so a move converts ZooKeeper data with clickhouse-keeper-converter during a planned stop.

ClickHouse migration

What happens to ClickHouse when Keeper loses quorum?

Replicated tables go read-only. SELECT queries keep working, but inserts, ALTERs, and ON CLUSTER DDL fail until the ensemble has a majority again. JusDB sizes the ensemble at three or five nodes across zones, keeps its disks separate from ClickHouse data, and alerts on leader loss before writes stop.

Does insert_quorum prevent data loss in ClickHouse?

insert_quorum makes an INSERT wait until the set number of replicas have written it, so one failed disk cannot take the only copy of a recent batch. It does not protect against a DROP or a bad mutation, which replicate like any other change, and it adds insert latency. JusDB turns it on per table where a lost batch cannot be replayed, and pairs it with tested backups.

Is ClickHouse Cloud highly available by default?

It depends on the tier. ClickHouse Cloud Basic runs a single replica in one zone. Scale and Enterprise services can run replicas across two or more zones, and ClickHouse describes Scale as built for deployments of two or more replicas. JusDB checks the replica count and backup schedule of each service against your recovery targets.

What SLA response times apply to ClickHouse incidents?

24/7 support. SLA response times: P1 – 15 mins | P2 – 30 mins | P3 – 60 mins. Our engineering team is in India (IST, UTC+5:30) and provides 24/7 support. Response means an on-call engineer is working the incident, not an automated reply. Recovery targets (RTO and RPO) are agreed per client and tested in drills, not promised in advance.

Related ClickHouse services

Other ways JusDB works on ClickHouse.

Ongoing operations, architecture reviews, Kubernetes, upgrades, and tuning.

Operations

ClickHouse remote DBA

Ongoing monitoring of replicas, Keeper, parts, and backups, with incident response.

Explore service
Architecture

ClickHouse consulting

Table design, cluster layout, and ClickHouse Cloud decisions, scoped as one project.

Explore service
Kubernetes

ClickHouse on Kubernetes

Keeper, replicas, and storage run by the Altinity or official operator.

Explore service
Upgrades

ClickHouse migration

Version upgrades, ZooKeeper to Keeper, and moves to or from ClickHouse Cloud.

Explore service
Performance

ClickHouse performance tuning

Replica delay, merges, part counts, and memory, measured before and after.

Explore service

Related ClickHouse Services

Explore more ways our ClickHouse experts can help with your database infrastructure.

Find out which failures your cluster survives

Review your ClickHouse high availability with an engineer.

A scoping call covers your shards, replicas, Keeper, and backups. P1 response SLA: 15 mins, 24/7.