Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

ClickHouse 23 min read Case study mediumAdept

Building ClickHouse Cloud From Scratch in a Year

ClickHouse Cloud was built in about a year on a "shared everything" architecture: compute and storage are separated, object storage (S3/GCS) is the primary store, and local SSDs handle caching and metadata. Control Plane and Data Plane are decoupled by a REST API façade plus SQS/PubSub for async events. Key infrastructure choices were managed Kubernetes (EKS) over kOps, Cilium over Calico for eBPF-based network isolation, Istio/Envoy SNI routing to get around per-account NLB limits, and shared S3 buckets with per-service subpaths to avoid bucket limits. Auto-scaling uses a Knative-style idler that suspends idle pods and a custom scaler with disruption budgets suited to stateful services. Object storage forced extra work on caching, prefetching and write-cost optimization.

Related posts

  • Building ClickHouse BYOC (Bring Your Own Cloud) on AWS

    ClickHouse mediumAdept

    ClickHouse BYOC on AWS splits a ClickHouse-hosted management plane from a data plane EKS cluster in the customer's VPC, provisioned automatically with CloudFormation and Crossplane. Support access is approved, audited, time-bound and routed through Tailscale. Engineers authenticate with temporary certificates tied to a ClickHouse user profile that can read only system tables such as query_log, never customer data. Custom Profiles with node-group labels and node selectors replaced the default scheduler plus cluster autoscaler, which had wasted resources because of DaemonSet overhead and poor scale-in behaviour on m7gd node pools. Customers choose maintenance windows for upgrades, and ClickHouse handles EKS version maintenance.

  • Observing in style: How Poizon rebuilt its data platform with ClickHouse Enterprise Edition

    ClickHouse mediumAdept

    Poizon moved its distributed-tracing observability store, which ingests petabytes of trace data daily, from self-hosted single-replica ClickHouse on cloud disks to ClickHouse Enterprise Edition on Alibaba Cloud. The new setup separates storage and compute: SharedMergeTree keeps data in object storage, compute nodes are stateless, and new nodes join via Keeper metadata sync without pausing writes or resharding. Writes are spread across nodes with round-robin, switching to weighted round-robin during restarts, and queries use parallel replicas and tuned ORDER BY keys. Reported results are up to 20M rows/sec ingest, up to 2.5x faster queries in some cases, more than 70% lower storage cost and about 60% lower overall infrastructure cost.

  • Building ClickHouse Cloud on Microsoft Azure

    ClickHouse mediumAdept

    ClickHouse Cloud's Azure data plane reuses its CSP-neutral design (AKS, Blob Storage, VNETs, Entra ID, managed Cilium) but had to adapt to several Azure-specific constraints. To avoid per-subscription limits such as 980 resource groups and 500 storage accounts, customer services are randomly placed in a pool of subscriptions, each getting its own resource group. Cells (independent VNET plus AKS environments routed via DNS) handle Kubernetes and cloud scaling limits. Because Azure NAT Gateway is zonal and AKS doesn't support application security groups, the team uses per-AZ subnets, three AKS node groups per cluster, and Network Security Groups for inter-cluster isolation.

  • Introducing Warehouses: Compute-compute separation in ClickHouse Cloud

    ClickHouse mediumAdept

    ClickHouse Cloud Warehouses let multiple services, each with its own endpoint, compute nodes, sizing, idling and network access rules, read and write the same data, isolating workloads such as ingestion, BI dashboards and ad-hoc analysis. Data sharing rests on storage-compute separation over object storage, SharedMergeTree metadata kept in a shared Keeper cluster, and replica groups in the Replicated database that keep distributed queries inside each service. Read-only services skip background merges, so they are fully isolated from write load, while multiple read-write services can still affect each other through merges. The recommended setup is a single read-write service for ingestion with read-only services for everything else. Current limits include a primary service that cannot be idled and DDL that idle services can block (worked around with distributed_ddl_task_timeout=0).

  • Building a Distributed Cache for S3

    ClickHouse mediumAdept

    ClickHouse Cloud adds a distributed cache that turns the per-node filesystem cache into a shared network service, so every compute node can read hot table data that any other node has fetched. Hot data caching evolved from the OS page cache on local disks, to per-node SSD filesystem caches in front of S3, to this shared layer. Per-node caches went cold whenever nodes were added, replaced or resized, and object storage tail latency (~500 ms) cannot be hidden by parallelism. Intra-zone network latency of 100–250 µs and multi-GB/s throughput make a shared cache feasible, and benchmarks show it beating a self-managed SSD server even from a cold start.

The quest for software engineering knowledge.

Look:
Layout: