A time-series database stores timestamped samples grouped into stable series. It earns its place when ingestion, retention, compression, and time-window aggregates dominate the workload; a timestamp column alone does not require one. PostgreSQL with time partitioning can be enough at moderate cardinality and ingestion rates. A specialized TSDB becomes useful when label indexing, compressed chunks, and long-range rollups are the bottleneck.

Series and Cardinality

In Prometheus, a series is the metric name plus its complete label set:

http_request_duration_seconds_count{service="checkout",method="POST",status="200"} 8431 1721044800000

Changing any label value creates a different series. Bounded labels such as service and status are useful dimensions. An unbounded label such as user_id creates a series per user, expanding the index and active-series memory until ingestion or queries fail.

Storage Decisions

DecisionEngine behaviorFailure mode when wrong
Series keyIndex a stable metric name and bounded labelsUnbounded labels exhaust memory and index space
Time partitionKeep chunks or partitions ordered by timeRange reads and retention deletion scatter across storage
RetentionDrop whole expired chunks or partitionsRow-by-row expiry amplifies writes and compaction
RollupsPersist lower-resolution aggregatesLong dashboards repeatedly scan raw samples
Late dataDefine an allowed lateness windowOld samples rewrite sealed chunks or disappear from aggregates

The diagram is a workload selector, not a rule that every metrics system needs a dedicated TSDB. The decision turns on measured cardinality, ingest rate, retention volume, and query windows.

Concrete Boundary

At 10,000 samples per second, a 15-day raw retention window contains about 13 billion samples. If most dashboards query 5-minute rates over 30 days, keeping only raw samples forces repeated wide scans. Time-partitioned raw chunks plus a persisted 5-minute rollup make retention a partition drop and bound the dashboard input. The cost is extra write work and the need to define how late samples repair an already-built rollup.

References