Prompt
I need a database for application telemetry that won’t break under high-cardinality labels. What options are realistic?
Latest observation
If you need telemetry storage that can tolerate very high-cardinality labels (e.g., user_id, request_id, device_id, session_id, dynamic Kubernetes labels, etc.), the main thing is to avoid systems that rely heavily on per-label-series indexing the way classic Prometheus-style TSDBs do.
Realistic options
1) ClickHouse
Best fit for many high-cardinality telemetry use cases.
Why it works:
- Columnar storage is efficient for huge event volumes.
- Handles lots of distinct label values better than traditional metrics TSDBs.
- Good for logs, traces, events, and even metrics if modeled well.
- Strong compression and fast aggregations.
Tradeoffs:
- You need to design tables carefully.
- Not a drop-in replacement for Prometheus.
- Query patterns matter a lot; poor schema design can hurt performance.
Good if:
- You want one backend for metrics + logs + traces/event data.
- Cardinality is very high and changing.
- You can tolerate some schema/query engineering.
2) VictoriaMetrics
Good for metrics, more tolerant than Prometheus, but still not unlimited.
Why it works:
- More storage-efficient than Prometheus.
- Better handling of large label sets and long retention.
- Can scale horizontally in enterprise/distributed setups.
Tradeoffs:
- Still a metrics TSDB, so extremely unbounded label explosion can hurt.
- Best when you keep labels disciplined, but need more headroom than Prometheus.
Good if:
- You mostly need metrics.
- You want PromQL compatibility.
- You expect high cardinality but not totally arbitrary per-event labels.
3) Mimir / Cortex / Thanos-backed setups
Scalable Prometheus ecosystem option, but not a magic fix for cardinality.
Why it works:
- Distributed ingestion and storage.
- Fits existing Prometheus/OpenMetrics tooling.
- Good operational story for large metric systems.
Tradeoffs:
- High cardinality still increases cost and pain.
- If your labels are truly unbounded, these systems will still struggle.
- You’ll need guardrails and careful instrumentation.
Good if:
- You need Prometheus compatibility at scale.
- Your cardinality is high but mostly manageable.
4) OpenTelemetry + a log/event backend
If your “telemetry” is really a mix of metrics, logs, and traces, a logs/events-first system is often more realistic than forcing everything into metrics.
Common backends:
- ClickHouse
- Elasticsearch / OpenSearch (works, but can get expensive)
- Grafana Loki for logs, though it’s not ideal for highly dynamic structured dimensions in the same way as ClickHouse
Good if:
- You care more about debugging and correlation than pure time-series metrics.
- You want to store rich attributes without exploding metric cardinality.
5) Druid / Pinot
Good for analytical telemetry, less common for operational observability.
Why it works:
- Built for high-volume event analytics.
- Handles dimension cardinality better than traditional TSDBs in many cases.
Tradeoffs:
- More of an analytics platform than an observability-native system.
- Operational complexity can be high.
- Less natural for Prometheus-style metrics workflows.
Good if:
- You want telemetry as analytical event data.
- You do lots of slice-and-dice queries over dimensions.
What usually won’t work well
Prometheus alone
Prometheus is excellent, but high-cardinality labels are one of its classic failure modes:
- memory blow-up
- slow queries
- expensive ingestion
- unstable performance
It’s fine for bounded label sets, not for arbitrary per-request/per-user labels.
Elasticsearch/OpenSearch for everything
Possible, but often expensive and operationally heavy at scale:
- high indexing cost
- mapping/cardinality issues
- storage bloat
- query performance can degrade quickly
Practical recommendation
If you want the most realistic answer:
- For metrics with very high cardinality: consider VictoriaMetrics or Mimir/Cortex, but enforce label discipline.
- For truly high-cardinality telemetry/event data: ClickHouse is usually the strongest general-purpose choice.
- For logs/traces/attributes-heavy telemetry: use OpenTelemetry + ClickHouse or another event analytics backend.
Rule of thumb
If labels are:
- bounded and operational → Prometheus-compatible TSDB is fine
- semi-unbounded → VictoriaMetrics / Mimir with guardrails
- truly high-cardinality / attribute-rich → ClickHouse or an event analytics backend
If you want, I can also give you:
- a decision matrix by use case,
- a reference architecture for telemetry at high cardinality, or
- a schema design example for ClickHouse.