Skip to content

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

ClickHouse 32 min read Case study mediumAdept

How we Built a 19 PiB Logging Platform with ClickHouse and Saved Millions

ClickHouse replaced Datadog for internal logging with LogHouse, a per-region ClickHouse deployment holding over 19 PiB uncompressed (37 trillion rows) for its AWS regions. The data compresses about 17x on S3-backed SharedMergeTree storage with local NVMe caches, and the team claims the system is at least 200x cheaper than Datadog list pricing. A team of 1.5 engineers built it in under three months. Key design choices were OpenTelemetry collectors writing directly to ClickHouse with no Kafka buffer, no cross-region data transfer (queries span regions instead), and a move from plaintext to structured JSON logs. Frequently queried fields such as pod_name are extracted into ordering-key columns, while the rest is stored in a Map(String, String). Tradeoffs include higher in-transit drop rates, caused by uneven agent-to-gateway connections and the lack of autoscaling in the ingest layer.

Assumes: ClickHouse basicslog collection pipelinesKubernetes basics

Related posts

  • Clever ingests 200x more logs at the same cost with ClickHouse Cloud

    ClickHouse mediumAdept

    Clever replaced a split Datadog/Athena logging setup with ClickHouse Cloud. It now indexes all ~150 TB/month of logs from 400 services and 200 Lambdas with 60-day retention, a 200x increase in searchable volume, at no extra cost and with 10x compression. The schema extracts hot fields into columns and stores the rest as raw JSON plus an attributes map. It uses token bloom filter indexes at granularity 32 for full-text search, date partitions with a 60-day TTL, and orders by negative Unix timestamp for an 8-10x query speedup. Resilience comes from separate dev and per-region prod services joined via remoteSecure and merge tables, all managed with Terraform and Goose. A custom LogQL-to-SQL layer keeps Grafana familiar for engineers.

  • Scaling our Observability platform beyond 100 Petabytes by embracing wide events and replacing OTel

    ClickHouse mediumAdept

    ClickHouse's internal LogHouse platform grew from 19 PiB to over 100 PB of uncompressed logs (about 500 trillion rows), mostly by replacing the OpenTelemetry pipeline for ClickHouse server telemetry with SysEx. SysEx is a pull-based Go exporter that copies system tables byte-for-byte from customer pods into LogHouse in ClickHouse's Native format. It assigns pods to scrapers with a hash ring and queries a sliding time window trailing real time by about five minutes, so internal buffers flush before rows are read. Schema drift is handled with hashed, versioned tables unified through the Merge engine. The OTel collectors needed 800+ cores for 2M logs/s and still dropped events, while SysEx ships 37M logs/s on about 70 cores with no edge loss. HyperDX now replaces the team's Grafana-based UI.

  • A Quadrillion Rows across three Clouds: scaling LogHouse

    ClickHouse mediumAdept

    LogHouse, ClickHouse Cloud's internal logging platform, has grown to 431 PiB uncompressed (27 PiB on disk) and 1.59 quadrillion rows across 36 cells in 33 geoshards on three clouds, ingesting up to 80 GiB/s and 190M rows/s. Writes stay local to each region, with busy regions split into cells keyed by source Kubernetes cluster. Async Inserts cut part creation by 4–24x, and the largest tables moved from monthly to daily partitions once parts hit the max merge size. OTel collectors spill failed batches to S3 so that outages cause delay rather than data loss. On the read side, a three-level Distributed table hierarchy (global, regional, local SharedMergeTree) with region-named shards for pruning gives users one endpoint and sub-second cross-cloud queries.

  • How trip.com migrated from Elasticsearch and built a 50PB logging solution with ClickHouse

    ClickHouse mediumAdept

    Trip.com replaced its Elasticsearch-based centralized logging platform with ClickHouse after hitting stability, ingestion and cost limits at 4PB, and has since grown it toward 50PB. The migration used a ReplicatedMergeTree schema with daily partitions, ZSTD codecs, LowCardinality columns, tag key/value arrays and tokenbf_v1 bloom-filter indexes. Kibana was extended with custom ClickHouse panels, and scripts migrated 95% of dashboards automatically. The result was over 50% storage savings and queries 4–30x faster (P90 under 300ms). Further growth caused ZooKeeper-driven DDL timeouts, which led trip.com to split into multiple clusters and to evaluate ClickHouse Cloud with SharedMergeTree.

  • Didi Migrates from Elasticsearch to ClickHouse for a new Generation Log Storage System

    ClickHouse mediumAdept

    Didi replaced Elasticsearch with ClickHouse for petabyte-per-day log and trace storage, cutting machine cost by 30% and speeding up queries about 4x on a 400+ node single-replica deployment peaking at 40 GB/s writes and ~200 QPS. A single Flink write pipeline feeds a Log cluster, and materialized views populate a physically isolated Trace cluster plus AggregatingMergeTree trace index tables, with cold data tiered to HDFS. Schema design rounds log time to the hour as the leading sort key, partitions by day, and moves unfiltered fields into Map columns to limit small files. Operational fixes covered per-table write-node allocation for low-traffic tables, Flink-side throttling, a native TCP Flink connector, and HDFS tiering changes that cut restart time from 1 hour to 1 minute.

The quest for software engineering knowledge.

Look:
Layout: