Skip to content

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

ClickHouse 13 min read Case study mediumAdept

Building ClickHouse BYOC (Bring Your Own Cloud) on AWS

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.

Related posts

  • Building ClickHouse Cloud From Scratch in a Year

    ClickHouse mediumAdept

    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.

  • Introducing external backups on ClickHouse Cloud

    ClickHouse mediumAdept

    ClickHouse Cloud can now export service backups to a customer-owned bucket on AWS, GCP or Azure, in any region of the same provider. Cross-cloud backups are not yet supported and are on the roadmap. Setup on AWS means creating an IAM role the service can assume, with a trust policy and an S3 permissions policy, then registering the role ARN and bucket URL in the console. Backups run daily by default on a configurable schedule. External backups are always full rather than incremental, so a broken chain cannot make later backups unrecoverable, which caps frequency at once per day. They are also never lifecycled by ClickHouse, so retention through bucket TTL policies or scripts is the user's job. Restores run as a templated SQL RESTORE command from a new service, which can be edited if backups were moved and surfaces permission or path errors directly.

  • 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.

  • Agentic infrastructure with clickhousectl: a distributed ClickStack across three continents

    ClickHouse mediumAdept

    A coding agent using the clickhousectl CLI stood up three ClickHouse Cloud services in us-east-1, eu-west-1 and ap-northeast-1, each ingesting OpenTelemetry logs, traces and metrics locally, with a federated global view in Europe for the ClickStack UI. The global view combines remoteSecure() table pointers to the remote regions with a Merge engine table over local and remote tables, so data stays resident in its region and is fetched only at query time. The agent scripted provisioning by parsing JSON output with jq and polling service status, then added SQL-based and native ClickStack alerts. The broader argument is that a scriptable CLI with clean JSON output suits agent-driven infrastructure better than a web console.

  • 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).

The quest for software engineering knowledge.

Look:
Layout: