Skip to content

Time Series Databases

What is a Time Series Database?

A time series database (TSDB) is a database specifically designed for storing and querying timestamped data -- data points that are indexed and ordered by time.

Every data point in a time series database is automatically associated with a timestamp, making it easy to analyze how values change over time.

Key Characteristics

  • Optimized for high-volume writes of timestamped data
  • Efficient time-range queries (e.g., "last 24 hours" or "between March 1 and March 7")
  • Built-in support for aggregation over time windows (averages, sums, min/max)
  • Often include data retention policies to automatically delete old data

Common Use Cases

Use CaseExample
IoT monitoringSensor readings from temperature, humidity, or motion sensors
Infrastructure monitoringCPU usage, memory consumption, disk I/O from servers
Financial dataStock prices, exchange rates, transaction volumes
Application metricsRequest latency, error rates, active users

How Does It Differ from Other Databases?

FeatureRelational (MySQL)Document (MongoDB)Time Series (InfluxDB)
Primary keyUser-defined IDObjectIdTimestamp
Data modelTables with rowsJSON documentsMeasurements with fields and tags
Query focusFlexible joinsDocument lookupsTime-range aggregations
Write patternMixed reads/writesMixed reads/writesMostly writes, append-only
Best forStructured business dataFlexible, nested dataHigh-volume timestamped data
DatabaseDescription
InfluxDBOpen-source, purpose-built time series database
TimescaleDBPostgreSQL extension for time series data
PrometheusMonitoring-focused TSDB, commonly used with Grafana
QuestDBHigh-performance TSDB with SQL support

In this course, we use InfluxDB 2 as our time series database.

InfluxDB 3

A newer version, InfluxDB 3, was released in 2025. It replaces the Flux query language with standard SQL and InfluxQL. However, InfluxDB 3 does not include a built-in web UI -- it requires a separate Docker-based Explorer tool. Docker installation is not covered in this course, so we use InfluxDB 2 which includes a built-in graphical interface.

Lapland University of Applied Sciences

© 2026 Juha Petäjäjärvi

© 2026 Juha Petäjäjärvi