What Is a Time-Series Database? Storing and Querying Measurements Over Time
A time-series database is a database or storage design suited to continuously recording measurements tied to time and querying trends, anomalies, or summaries over time ranges. Typical data includes server metrics, sensor readings, heart rate, and prices—repeated observations of a subject over time. A timestamp column alone does not require a separate time-series database; compare write volume, query patterns, retention needs, and your existing system.
What does time-series data look like?
A time series is usually a sequence of observation times and measured values. Observations may arrive at regular intervals or irregularly whenever events occur. Because “when was it observed?” affects the meaning of a value, the timestamp is a core data dimension, not incidental metadata. It can also help to distinguish when a device observed a value from when a server received it. Recording both may help diagnose collection delays or network interruptions.
Imagine storing CPU utilization from several servers every ten seconds. One point could include a time, a server identifier, and a CPU value. In InfluxDB 3 Core line protocol, a point is represented with a table name, optional tags, one or more fields, and an optional timestamp:
cpu,host=web-03,region=ap-northeast usage=0.72 1795315200000000000This illustrative observation belongs to the cpu table. host and region are tags describing source or context, usage is a measured field, and the final number is an example Unix timestamp in nanoseconds. The value and record are illustrative; they were not collected from a real server or submitted. Terms and formats differ by store.
How does it differ from a general-purpose database?
Time-series workloads often continuously add recent data and ask questions bounded by time, such as “the maximum in the last 15 minutes,” “hourly average by device,” or “this sensor’s records from last month.” Products for time-series work may support time-based partitioning, range queries, compression, aggregation, and retention, or provide structures suited to them. For example, a TimescaleDB hypertable is an extension that behaves like a PostgreSQL table in SQL while splitting data into time-range chunks. Not all time-series databases use the same internals.
A general relational database can also handle time-series data when indexes and partitioning fit the workload. If you already use PostgreSQL and need relational joins, constraints, and transactions, an extension such as TimescaleDB or ordinary partitioned tables may fit naturally. If sustained ingestion of measurements and time-centered aggregation dominate, compare dedicated products such as InfluxDB. Do not assume one option is always faster; evaluate representative data and queries.
| Option | When to consider it | Costs and limits to check |
|---|---|---|
| Existing relational tables | Data volume and write rate are manageable; joins, constraints, and existing SQL matter | Index size, partition maintenance, and deletion of old data |
| Time-series extension for a relational database | Keep SQL and the relational ecosystem while adding time-oriented partitioning or aggregation | Extension installation and version compatibility, chunk sizing, operating policies |
| Dedicated time-series database | Continuous measurement ingestion, time-range queries, retention, and summaries are central | Product-specific data model and query language, backup/recovery, integrations, and capacity cost |
How should you design the model and retention?
Schema design is easier when you separate a measured value from the context used to classify it. In InfluxDB documentation, tags represent source or context such as host or location; fields hold measurements that change over time, such as temperature, pressure, or price. Tags may be indexed in a particular product, but this behavior and the cost of unique tag values differ by engine version. For example, InfluxDB 3 Core says tag-value cardinality does not affect overall performance in the same way as earlier TSM-based versions. Do not apply older general advice to every version; check the documentation for the one you choose.
In practice, decide how to represent frequently filtered context such as host, region, or sensor_type and numeric measurements such as usage or temperature. Before making frequently changing or effectively unbounded identifiers into tags, check the product’s index and primary-key model. If different sources write inconsistent column names into one table, the result can be sparse; keep field names and types consistent and avoid adding columns that your queries do not need.
Plan retention and summaries together. Keeping raw data briefly and retaining only hourly averages or daily maxima for longer can reduce storage, but you will no longer be able to answer historical questions at finer granularity. TimescaleDB continuous aggregates can refresh summaries of a source hypertable by time bucket. However, if the source-data deletion policy overlaps the aggregate refresh window, values you expected to retain in the aggregate can disappear too. Coordinate both policies and check recovery requirements for raw and summarized data before changing retention.
How do you decide before adopting one?
First record what values arrive, how often, and from how many devices or users. Then list real reads and operational tasks: recent dashboards, time-window queries by device, long-term trends, alerts, reprocessing, and backfills. Decide how to represent observation time and time zones (usually UTC), how to handle late or duplicate observations, and how long raw and summarized data must remain available. With these requirements, load the same sample data into a general database and candidate time-series products, then compare representative queries, write load, retention, and recovery procedures.
A time-series database is a useful option when collecting, querying, and managing observations centered on time. The mere presence of timestamps is not enough to choose one. Include needed relational capabilities, query style, operational skills, retention, and recovery in the decision. Since data models and partitioning differ, base the final choice on the official documentation for the selected version and a reproducible workload evaluation.
Sources and scope
[InfluxDB 2.10 Getting Started: time-series data model and concepts](https://docs.influxdata.com/influxdb/v2/get-started/)
[InfluxDB 3 Core schema design recommendations](https://docs.influxdata.com/influxdb3/core/write-data/best-practices/schema-design/)
[InfluxDB 3 Core line protocol](https://docs.influxdata.com/influxdb3/core/reference/line-protocol/)
[Timescale hypertables and time chunks](https://github.com/timescale/docs/blob/latest/use-timescale/hypertables/index.md)
[Timescale continuous aggregates and refresh policies](https://github.com/timescale/docs.timescale.com-content/blob/master/using-timescaledb/continuous-aggregates.md)
[Timescale retention and continuous aggregates](https://github.com/timescale/docs.timescale.com-content/blob/master/using-timescaledb/data-retention.md)
Official InfluxDB 2.10/3 Core and Timescale documentation was checked on 2026-11-22. Product-specific models are not presented as universal rules for all time-series databases. The line-protocol record and data volume are illustrative; no data was sent, code executed, or performance measured.