Skip to content

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

ClickHouse 7 min read Case study mediumAdept

How Netflix optimized its petabyte-scale logging system with ClickHouse

Netflix's logging system ingests 5 PB/day (10.6M events/s average, ~5 KB each) with ClickHouse as the hot tier and Apache Iceberg for long-term storage, making logs searchable within about 20 seconds. Three optimizations made this possible. Replacing regex-based log fingerprinting with a JFlex-generated lexer raised throughput 8-10x, cutting average time from 216 to 23 µs. Swapping JDBC batch inserts first for RowBinary and then for a custom native-protocol encoder with LZ4-compressed blocks lowered CPU and memory use. Sharding the Map(String, String) tag column into 31 hash-bucketed maps cut tag queries from ~3s to 1.3s for filters and under 700ms with projections, scanning 5-8x less data.

Assumes: ClickHouse basicslog ingestion pipelinescolumnar data types

Related posts

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

    ClickHouse mediumAdept

    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.

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

  • How Canva achieved 10x faster search and 70% lower costs with ClickHouse

    ClickHouse mediumAdept

    Canva moved tracing and logging (about 3 million spans and 3 million logs per second) onto a self-managed ClickHouse cluster of 5 shards × 3 replicas on Kubernetes. It reached a 14x compression ratio, cut costs by about 70%, and brought P90 trace search down from 30s to 2.5s. The ingestion gains came from batching roughly 200k spans per insert in OpenTelemetry collectors and writing straight to local tables. Search speed came from a sorting key aligned with Jaeger's filters, daily partitions, a materialized-view lookup table keyed by trace ID, and a client-side sliding search window. Logs flow through Kinesis and Lambda using tuned async inserts, with ngram Bloom filters on flattened log strings for free-text search and a custom DSL query gateway.

  • How Exabeam uses ClickHouse for scalable, searchable security analytics

    ClickHouse mediumAdept

    Exabeam runs its security analytics platform on ClickHouse Cloud across 10 regions, ingesting up to 1.2M events/sec per region (80B+ daily, 3.5 PB raw compressed to 200 TiB), with compute-compute separation that isolates write, merge and read nodes. Key optimizations: consolidating commonly queried fields into one wide column cut query latency from 8s to under 1s, folding sparse fields into a key-value column shrank the schema from 1,150 to 250 columns and raised throughput from 100K to 250K events/sec on three nodes, and ingestor tuning (Jackson over Gson, larger Gzip buffers, better serialization) cut memory 45%. Splitting backdated events into a separate backlog pipeline reduced part-file explosion and aborted merges, and replacing N-gram indexes with token-based indexes lowered hardware cost since regex queries were under 1% of workload.

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

The quest for software engineering knowledge.

Look:
Layout: