Prompt
I’m building an observability platform for multi-tenant metrics, what database should I use?
Latest observation
For a multi-tenant observability metrics platform, the best database is usually not a single “general-purpose” database. You want a storage engine optimized for:
- very high write throughput
- time-series data
- fast aggregations over time windows
- retention/downsampling
- tenant isolation / quotas
- horizontal scaling
Short answer
Best default choice
ClickHouse is often the best fit for a metrics observability backend if you need:
- high-cardinality metrics
- fast analytical queries
- cheap long-term storage
- multi-tenant aggregation at scale
Other strong options
- VictoriaMetrics: excellent if your workload is mostly Prometheus-style metrics and you want simplicity
- TimescaleDB: good if you want Postgres compatibility and moderate scale
- Mimir / Cortex / Thanos + object storage: good if you want a Prometheus-native distributed metrics stack
- Apache Druid: strong for analytics, but more operationally heavy
How to choose
Use ClickHouse if:
- you need ad hoc querying and analytics
- tenants have lots of metrics and dimensions
- you need flexible filtering/grouping
- you care about cost efficiency at scale
- you can design your own ingestion/query layer
Why it works well:
ClickHouse compresses time-series data extremely well and is very fast for scans, aggregations, and group-bys across large datasets.
Use VictoriaMetrics if:
- your system is mainly Prometheus-compatible
- you want a simpler operational footprint
- you need great ingestion performance with less tuning
- your queries are mostly standard metric queries
Why it works well:
It’s purpose-built for metrics and multi-tenancy, and it’s simpler than building on a general analytics DB.
Use TimescaleDB if:
- you already use Postgres
- your scale is moderate
- you need SQL and relational joins with metrics
- you want easier developer ergonomics than a specialized engine
Tradeoff:
It’s usually not the best choice for very large observability workloads compared with ClickHouse or VictoriaMetrics.
Use Mimir/Cortex/Thanos if:
- you want a Prometheus-like architecture
- you need long-term retention with object storage
- you want horizontal scale and HA
- you’re okay with more complex architecture
Note:
These are more “metrics systems” than a single database. They’re often a better fit than rolling your own database layer if you want Prometheus compatibility.
Recommended architecture for a serious multi-tenant platform
A common pattern is:
- Ingest API / metrics gateway
- Stream buffer / queue: Kafka / Pulsar / Kinesis
- Hot storage: ClickHouse or VictoriaMetrics
- Cold storage: S3/GCS/Azure Blob for long-term archives
- Query service: tenant-aware API with auth, rate limits, quotas
- Metadata store: Postgres for tenants, rules, RBAC, billing, configs
This gives you:
- backpressure handling
- replayability
- tenant isolation
- cost control
- scalable retention
Important multi-tenant design considerations
Whatever database you pick, make sure it supports or can tolerate:
- tenant ID in every row/partition
- per-tenant quotas
- rate limiting on ingestion
- query limits
- retention per tenant
- data isolation
- noisy neighbor protection
- cardinality control
Best practices
- partition by time + tenant
- keep tenant ID in primary sort key or clustering key
- enforce auth at the query layer, not only in the DB
- pre-aggregate where possible
- downsample older data
- store labels/tags carefully to avoid cardinality explosions
My practical recommendation
If you’re starting a new observability metrics platform:
Pick ClickHouse if:
- you want the most flexibility and scalability for custom observability analytics
Pick VictoriaMetrics if:
- you want a fast path to Prometheus-like metrics storage with less engineering effort
Pick Mimir if:
- you want to build around Prometheus ecosystem compatibility and object storage
If you want one answer:
ClickHouse is the best general-purpose database choice for a multi-tenant metrics observability platform.
If you want, I can also give you:
- a decision matrix comparing ClickHouse vs VictoriaMetrics vs TimescaleDB vs Mimir, or
- a reference architecture for multi-tenant metrics ingestion and query.