A specialized store
Metrics are streams of timestamped numbers tagged with labels. A time series database, or TSDB, is built specifically for this shape and vastly outperforms a general database for it.
What a series is
A single series is the unique combination of a metric name and its label set, for example request count for one service and one status code. Each series holds an ordered list of timestamp and value points.
Why a TSDB is efficient
- Append mostly writes arrive in time order, so storage is optimized for sequential appends rather than random updates.
- Compression is strong because timestamps are regular and values change slowly, so delta and bit packing shrink data dramatically.
- Downsampling rolls old high resolution data into coarser summaries to control long term cost.
- Retention policies automatically expire old points.
Querying
Queries select series by label matchers and a time range, then apply functions like rate, average, or quantile over windows. The label index makes finding matching series fast.
Key idea
A time series database stores label tagged numeric points in time order, using compression, downsampling, and retention to scale metrics affordably.