Prompt
How do I choose a time-series database for millions of metric points per second?
Latest observation
Choosing a time-series database for millions of metric points per second is mostly about matching the system to your workload, not just picking the “fastest” product.
1) Start with your requirements
Answer these first:
- Ingest rate: sustained and peak points/sec?
- Cardinality: how many unique time series?
(e.g., metric name + labels/tags like host, region, pod, service) - Retention: how long do you keep raw data? Do you need downsampling?
- Query patterns: dashboards, alerting, ad hoc analytics, high-cardinality filtering?
- Latency: what query latency is acceptable?
- Consistency/durability: can you lose some data, or do you need strong durability?
- Deployment model: self-hosted, managed cloud, single-region, multi-region?
- Cost constraints: storage, compute, ops overhead
At this scale, cardinality and query style matter as much as raw ingest throughput.
2) Choose the storage model
There are a few common TSDB styles:
A. Purpose-built time-series stores
Good for:
- very high ingest
- efficient retention/compression
- time-based partitioning
- downsampling and rollups
Examples:
- VictoriaMetrics
- Mimir / Cortex (Prometheus-compatible, horizontally scalable)
- InfluxDB
- TimescaleDB (Postgres-based, good when SQL matters)
- ClickHouse (great for analytics-heavy time series)
B. Search/log-oriented systems
Good for:
- flexible filtering
- mixed logs/metrics/traces
Examples:
- Elasticsearch/OpenSearch
Usually not the best choice if your only goal is cheap, high-volume metrics ingestion.
3) Match database to workload type
If you need Prometheus compatibility at huge scale
Consider:
- Grafana Mimir
- Thanos (more for long-term storage/aggregation than primary ingest)
- VictoriaMetrics
These are common when you already use Prometheus and need scaling.
If you need SQL and time-series analysis
Consider:
- TimescaleDB
- ClickHouse
Use these if you want joins, SQL, analytical queries, or existing SQL tooling.
If you need the simplest high-ingest metrics backend
Consider:
- VictoriaMetrics
- InfluxDB
- managed cloud metrics services if cost is acceptable
4) Evaluate the key technical factors
Ingestion throughput
Test with your real series shape:
- same metric volume
- same tag/cardinality distribution
- same write batch size
- same retention and replication settings
A database can look fast in benchmarks and still fail on your real cardinality profile.
Cardinality handling
High cardinality is often the real bottleneck.
Ask:
- How many active series can it handle?
- What happens when labels explode?
- Does performance degrade gracefully?
Compression and storage efficiency
At millions of points/sec, storage cost matters a lot. Look at:
- data compression ratio
- index size
- retention compaction overhead
Query performance
Check:
- dashboard latency for recent data
- large range scans
- group-by by label/tag
- top-N queries
- alerting query latency
HA and scaling
Need:
- replication?
- automatic sharding?
- rebalancing?
- multi-node writes?
- read replicas?
Operational complexity
Some systems are simple to run; others need a full distributed platform.
A good question is: Can my team operate this reliably at 3 a.m.?
5) Practical shortlist by scenario
Best for Prometheus-style metrics at large scale
- VictoriaMetrics
- Grafana Mimir
Best for SQL-centric analytics
- ClickHouse
- TimescaleDB for moderate-to-high scale and SQL needs
Best for managed simplicity
- cloud monitoring/metrics services, if cost is acceptable
Best if you need general analytics plus metrics
- ClickHouse
6) Run a realistic proof-of-concept
Before committing, benchmark:
- sustained ingest at peak
- burst ingest
- query load during ingest
- failover behavior
- retention/compaction overhead
- disk usage over time
- recovery time after node loss
Use your real labels, not synthetic low-cardinality data.
7) Common mistakes
- Choosing based on raw ingest benchmark only
- Ignoring cardinality growth
- Forgetting retention/downsampling costs
- Not testing query latency under concurrent ingest
- Underestimating operational burden
- Using a log/search system for pure metrics when a TSDB is better
8) A simple decision rule
- Prometheus ecosystem + massive scale: VictoriaMetrics or Mimir
- Need SQL and analytics: ClickHouse or TimescaleDB
- Want easiest operations and can pay for it: managed cloud metrics
- Need multi-purpose observability backend: consider a split architecture
9) Recommendation
For millions of metric points per second, I’d usually start with:
- VictoriaMetrics if you want efficient, practical metrics storage
- Grafana Mimir if you need horizontally scalable Prometheus compatibility
- ClickHouse if analytics/query flexibility is the top priority
If you want, I can help you build a comparison matrix for 3–5 databases based on your exact requirements.