DataTSDBtime-series databasemetrics store

Time series database

Definition

A time series database stores sequences of (timestamp, value) points per series, compresses them heavily, and answers range and aggregation queries over time windows.

In practice

Metrics, sensor readings and prices arrive as an append-only stream that is mostly queried by time range. TSDBs such as Prometheus, Mimir, VictoriaMetrics, InfluxDB and TimescaleDB exploit that: they buffer recent samples in memory, write immutable compressed blocks, often to object storage, and keep downsampled tiers for long-range queries.

Cost is driven by the number of active series more than by the number of samples, because each series needs memory and index entries. One unbounded label such as a user id can multiply series into the millions and take the database down, so limit cardinality per tenant. TSDBs are poor at storing individual events; use logs or traces for those.

Example

http_requests_total{service="checkout", status="500"} is one series; 200 services × 50 endpoints × 5 status codes × 30 pods makes 1.5 million active series.