ClickhouseRory Crispin, Dale McDiarmidExplainer
ClickHouse vs Prometheus for High Cardinality, Part 2: Cardinality in ClickHouse
Summary
Traditional time-series databases like Prometheus experience write amplification, memory overhead, and operational challenges when high-cardinality label combinations churn rapidly. ClickHouse alters these economics by abandoning dedicated series objects in favor of a wide events model, storing telemetry as rows in columnar tables with dynamic Map attributes and metric measurements. Dynamic attributes can be handled using sharded Map types alongside materialized columns and text indexes for frequently queried labels. This design trades ingestion overhead for query-time processing, relying on columnar compression, partition pruning, and parallel scans to compute aggregations on demand. ClickHouse avoids the ingest-side bottlenecks of high cardinality, though Prometheus remains preferable for moderate cardinality, native PromQL semantics, and single-series lookups.
Context
Series-oriented time-series databases like Prometheus incur high memory overhead, write amplification, and query tradeoffs when handling high cardinality and churn across label combinations.
Approach / What changed
ClickHouse models observability telemetry using a wide events architecture where timestamped events contain measurements and dynamic attributes in sharded Map types, allowing dynamic aggregation at read time.
Takeaways
The Map type is recommended over JSON for ClickHouse observability data, with sharded maps mitigating historical read-time I/O overhead.
ClickHouse shifts high-cardinality costs from ingestion-time series creation to query-time scanning, pruning, and parallel aggregation.
Prometheus remains superior for mature PromQL semantics, complex range vectors, and targeted single-series lookups on moderate-cardinality data.
Source and freshness
- Source
- clickhouse.com
- Published
- Added to Yomu
- Last updated
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.