ClickhouseRory Crispin, Dale McDiarmidExplainer
ClickHouse vs Prometheus for High Cardinality, Part 1: Understanding the Problem
Summary
Observability systems frequently encounter high cardinality when metrics contain numerous unique label combinations across multidimensional cloud infrastructure. In Prometheus, every unique label combination instantiates an independent time series that incurs metadata overhead, requires in-memory memSeries registration, and continually expands inverted index posting lists. The ingestion engine stores samples in two-hour Head blocks using compressed 120-sample chunks with XOR-based encodings, but rapid series creation and elevated scrape frequencies multiply chunk allocations and memory consumption. When executing read operations, broad aggregations and regular expressions require intersecting expansive posting lists and decoding entire chunks sequentially because the engine cannot push value predicates directly into compressed storage blocks. Consequently, managing high-cardinality workloads in series-oriented architectures forces operational trade-offs between system stability and granular visibility into ephemeral components.
Context
Traditional time-series systems face severe memory overhead, ingestion latency, and query degradation when tracking high-cardinality metrics generated by ephemeral workloads and multidimensional infrastructure.
Approach / What changed
The article analyzes Prometheus as a reference series-oriented model, detailing the underlying mechanics of memSeries allocations, chunk-based sample storage, inverted index posting lists, and read-path chunk decoding.
Takeaways
Each unique label combination in Prometheus creates an independent memSeries structure with approximately 200 bytes of base metadata plus chunk and label overhead.
Inverted indexes store posting lists referencing all series for each label pair, expanding significantly in memory and write overhead as cardinality increases.
Prometheus cannot push arbitrary value predicates down into compressed chunk storage, requiring full chunk decoding for every selected series during read operations.
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.