---
title: "ClickHouse Keeper: A ZooKeeper alternative written in C++"
description: "ClickHouse Keeper is a C++ drop-in replacement for ZooKeeper with the same client protocol and data model."
url: "https://swe.quest/articles/clickhouse-keeper-a-zookeeper-alternative-written-in-c-982cab848c27cdde"
canonical: "https://clickhouse.com/blog/clickhouse-keeper-a-zookeeper-alternative-written-in-cpp"
source: "ClickHouse"
published: "2023-09-27"
difficulty: "medium"
kind: "Case study"
reading_minutes: 16
tags: ["consensus","distributed-systems","performance","analytics","c-cpp"]
---

# ClickHouse Keeper: A ZooKeeper alternative written in C++

A post on [ClickHouse](https://swe.quest/sources/clickhouse.md), published 2023-09-27, 16 min read, Case study. Original: [https://clickhouse.com/blog/clickhouse-keeper-a-zookeeper-alternative-written-in-cpp](https://clickhouse.com/blog/clickhouse-keeper-a-zookeeper-alternative-written-in-cpp)

## Summary

ClickHouse Keeper is a C++ drop-in replacement for ZooKeeper with the same client protocol and data model. It adds better snapshot and log compression, no 1 MB node size limit, no ZXID overflow, faster partition recovery, and optional linearizable reads, and it is continuously validated with Jepsen tests. Measurements from loading WikiStat data into a 3-node ClickHouse Cloud service show how cluster size, part-size settings and data volume drive Keeper traffic, about 70% of which is multi-write transactions. A reusable keeper-bench-suite built on EC2, cAdvisor and Prometheus reproduces this workload and finds Keeper uses up to 46x less memory than ZooKeeper with comparable performance.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Consensus](https://swe.quest/tags/consensus.md) (Distributed systems)
- [Distributed systems](https://swe.quest/tags/distributed-systems.md) (Distributed systems)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)
- [Analytics & OLAP](https://swe.quest/tags/analytics.md) (Data & databases)
- [C & C++](https://swe.quest/tags/c-cpp.md) (Languages)

## Prerequisites

- ZooKeeper basics
- distributed coordination
- ClickHouse MergeTree ([easy posts on Analytics & OLAP](https://swe.quest/tags/analytics.md?difficulty=easy))

## Keywords

ClickHouse Keeper, ZooKeeper, ClickHouse, keeper-bench-suite, cAdvisor, Jepsen, SharedMergeTree

## Related posts

- [Bonree replaces ZooKeeper with ClickHouse Keeper for drastically improved performance and reduced costs](https://swe.quest/articles/bonree-replaces-zookeeper-with-clickhouse-keeper-for-drastically-improved-6eee02db0b20c225.md): ClickHouse · 2024-07-22 · Hard · 11 min read · Analytics & OLAP, Consensus, Distributed systems, Observability, Cost optimization
  Bonree migrated the coordination layer of its ClickHouse-based observability platform from five 3-node ZooKeeper clusters to a single ClickHouse Keeper cluster.
- [ClickHouse 22.3 LTS Released](https://swe.quest/articles/clickhouse-22-3-lts-released-3d54b5a68fa989fa.md): ClickHouse · 2022-04-12 · Medium · 9 min read · Analytics & OLAP, Databases, Testing, Storage systems
  ClickHouse 22.3 is a long-term support release (supported through March 2023) focused on maturity and reliability.
- [What’s New in ClickHouse 21.12](https://swe.quest/articles/what-s-new-in-clickhouse-21-12-d4461898493ff507.md): ClickHouse · 2021-12-16 · Medium · 9 min read · Analytics & OLAP, Query engines, SQL, Databases
  ClickHouse 21.12 marks ClickHouse Keeper as feature complete: it now supports ZooKeeper's four-letter monitoring commands and works as a drop-in ZooKeeper replacement, with compressed, checksummed logs and no zxid overflow or JVM tuning.
- [No more disks: the architecture behind stateless compute in ClickHouse Cloud](https://swe.quest/articles/no-more-disks-the-architecture-behind-stateless-compute-in-clickhouse-cloud-196ae85c7a09008f.md): ClickHouse · 2025-07-09 · Hard · 18 min read · Analytics & OLAP, Distributed databases, Storage engines, Caching, Cloud platforms
  ClickHouse Cloud compute nodes are now fully stateless and diskless.
- [Building Real-time Analytics Apps with ClickHouse and Hex](https://swe.quest/articles/building-real-time-analytics-apps-with-clickhouse-and-hex-28d6bbb0cc85e5a5.md): ClickHouse · 2023-04-07 · Medium · 15 min read · Analytics & OLAP, Data pipelines, Scheduling, Consistency models
  ClickHouse's git-import tool was run across the 50k most-starred GitHub repositories using a queue-worker model, with the job queue implemented as a KeeperMap table instead of an external queue like SQS.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
