Home / Companies / ClickHouse / Blog / Post Details
Content Deep Dive

ClickHouse vs Prometheus for High Cardinality, Part 2: Cardinality in ClickHouse

Blog post from ClickHouse

Post Details
Company
Date Published
Author
Why cardinality is different in ClickHouse #
Word Count
4,617
Language
English
Hacker News Points
-
Summary

The text delves into the challenges and solutions associated with handling high cardinality in observability data, contrasting the approaches of column-oriented databases like ClickHouse with series-oriented systems such as Prometheus. While Prometheus faces complexities with its model of treating each unique label combination as an independent series, resulting in memory overhead and operational complexity, ClickHouse leverages a "wide events" approach. This method represents metrics as rows with attributes that can be aggregated at query time, reducing the strain of high cardinality by storing data in a columnar format with compressed, sharded maps. While ClickHouse excels in flexibility, allowing dynamic labels and reducing I/O through efficient filtering and compression, it is not without its challenges, such as query-time costs for large GROUP BY operations. The text emphasizes that ClickHouse is not a direct replacement for Prometheus, highlighting its strengths in handling event-style observability data and long-term trend analysis, while Prometheus remains effective in scenarios requiring strict time-series semantics and real-time alerting.