ClickHouse vs Prometheus for High Cardinality, Part 1: Understanding the Problem
High cardinality hurts Prometheus because its storage unit is the individual series. Every unique label combination gets its own in-memory memSeries (~200 bytes plus labels), compressed chunks of about 120 samples, and inverted-index postings. Ephemeral labels such as container_id force constant series creation on the write path, and stale series linger in the Head block for hours until the post-block-cut truncation removes them. The usual mitigations (per-scrape limits, relabeling, longer scrape intervals, dropping labels) protect stability by discarding data, which sets up a follow-on comparison with column-oriented stores like ClickHouse.
Related posts
- ClickHouse vs Prometheus for High Cardinality, Part 2: Cardinality in ClickHouse
ClickHouse mediumAdept
ClickHouse handles high-cardinality observability data by storing telemetry as wide events, rows of attributes plus measurements, instead of as independently maintained time series. A new label combination therefore adds a row rather than a new in-memory series object, so cardinality is paid mostly at query time rather than at ingestion. The recommended schema keeps dynamic labels in a sharded Map, materializes frequently filtered labels and metrics into typed columns in the sorting key, and adds inverted text indexes over map keys and values. Sparse primary indexes, granule pruning, per-column codecs and bucketed map serialization (2–49× faster single-key lookups) keep I/O and storage low, though ClickHouse is not a drop-in Prometheus replacement.
- How the D. E. Shaw group powers high-cardinality observability at scale with ClickHouse
ClickHouse mediumAdept
The D. E. Shaw group moved per-task resource metrics from its HPC grid, millions of high-cardinality time series keyed by unique task IDs, from an InfluxDB-protocol time-series platform to ClickHouse. In same-hardware benchmarks, a single ClickHouse node ingested about 3.5M samples/s against roughly 480k for a competitor, and queries that timed out elsewhere finished in seconds. Production keeps the InfluxDB line-protocol ingestion path through a custom batching service, backfills history by reading the old platform's files directly from disk, and stores 68 TB compressed on four replicated NVMe servers at about 530k inserts/s, with materialized views for capacity-planning dashboards. Tradeoffs included rewriting Prometheus-style queries in SQL and limited compression on unique-ID fields (up to 5x), while OpenTelemetry traces reach about 12.5x compression.
- Top 10 best practices tips for ClickHouse
ClickHouse mediumAdept
Ten practices for getting performance and storage efficiency out of ClickHouse, each measured on a 150M-row Amazon reviews dataset. Aligning ORDER BY with query filters (low-cardinality columns first) made one query 3x faster and cut scanned data 347x. Right-sized types, no Nullable and LowCardinality(String) doubled query speed and shrank storage. Partitioning is best avoided except for TTL expiry or FINAL on merge engines; monthly partitions slowed one aggregation 46x. The post also covers lightweight versus heavyweight skipping indexes, JSON type hints (38% less storage, 26% faster), and preferring Parquet/ORC for bulk ingestion.
- NYC Meetup Report: Large Scale Financial Market Analytics with ClickHouse (Bloomberg)
ClickHouse easyNovice
Bloomberg's Structured Products team uses ClickHouse to power a Terminal application where a few users run interactive filter-and-group queries across roughly 100 million securities. The dataset is about 5 billion rows and 100 columns. Columnar storage keeps rarely used columns available without holding them in memory. The team prioritized ingestion over query speed: they build a new table for each change, such as adding a column, and stage data through buffer tables, which lets them load 4 TB in under an hour while keeping data fresh. Every query puts load on ZooKeeper, a single point of failure the team tests with disaster-recovery drills, and they plan to try Kubernetes, S3-backed storage and ClickHouse Keeper.
- So, is ClickHouse winning the observability wars?
ClickHouse mediumAdept
ClickHouse has become a common storage and query layer for observability, and the main reason is its columnar architecture. Data sorted by an ordering key compresses well (users report 10–50x), queries read only the columns they need, sparse primary and skip indexes prune granules, and execution is vectorized and SIMD-friendly and runs in parallel across shards. The newer inverted-index full-text search cut multi-term log searches in one customer report from 30–45s to about 400ms. High-cardinality fields cost little in a columnar store compared with Prometheus's per-series model, though grouping by millions of values still costs memory. The engine is only the foundation; collection, schema, correlation and workflows still have to be built, which is where ClickStack comes in.