Appearance
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 Case | Example |
|---|---|
| IoT monitoring | Sensor readings from temperature, humidity, or motion sensors |
| Infrastructure monitoring | CPU usage, memory consumption, disk I/O from servers |
| Financial data | Stock prices, exchange rates, transaction volumes |
| Application metrics | Request latency, error rates, active users |
How Does It Differ from Other Databases?
| Feature | Relational (MySQL) | Document (MongoDB) | Time Series (InfluxDB) |
|---|---|---|---|
| Primary key | User-defined ID | ObjectId | Timestamp |
| Data model | Tables with rows | JSON documents | Measurements with fields and tags |
| Query focus | Flexible joins | Document lookups | Time-range aggregations |
| Write pattern | Mixed reads/writes | Mixed reads/writes | Mostly writes, append-only |
| Best for | Structured business data | Flexible, nested data | High-volume timestamped data |
Popular Time Series Databases
| Database | Description |
|---|---|
| InfluxDB | Open-source, purpose-built time series database |
| TimescaleDB | PostgreSQL extension for time series data |
| Prometheus | Monitoring-focused TSDB, commonly used with Grafana |
| QuestDB | High-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.