InfluxDB — Scalable Time Series Datastore for Metrics & Events
InfluxDB is a scalable time series database for metrics, events, and real-time analytics. InfluxDB 3.0 is a complete rewrite in Rust with columnar Apache Arrow storage, SQL and InfluxQL queries, and unlimited cardinality.
What it is
InfluxDB is a scalable time series database optimized for metrics, events, and real-time analytics. Version 3.0 is a complete rewrite in Rust built on Apache Arrow columnar storage (via DataFusion), providing SQL query support, unlimited cardinality, and significantly improved analytics performance compared to earlier versions.
InfluxDB targets DevOps teams, IoT developers, and anyone who needs to store, query, and visualize time-stamped data at high volume.
How it saves time or tokens
InfluxDB eliminates the need to adapt a general-purpose database for time-series workloads. Its line protocol allows ingesting millions of data points per second with a single HTTP POST. Built-in retention policies automatically delete old data, and continuous queries downsample high-resolution metrics into aggregated summaries. The SQL support in v3 means existing SQL knowledge transfers directly, removing the learning curve of custom query languages.
How to use
- Run InfluxDB with Docker:
docker run -d --name influxdb -p 8086:8086 influxdb:3
- Create a database and token:
influxdb3 create token --permission '*'
influxdb3 create database metrics
- Write data using the line protocol:
curl -XPOST 'http://localhost:8086/write?db=metrics' \
-H 'Authorization: Token $INFLUXDB_TOKEN' \
--data-raw 'cpu,host=server01,region=us-west usage_user=23.5 1609459200000000000'
- Query with SQL (v3):
SELECT host, mean(usage_user) as avg_cpu
FROM cpu
WHERE time >= now() - INTERVAL '1 hour'
GROUP BY host
ORDER BY avg_cpu DESC;
Example
A monitoring setup writing CPU and memory metrics:
# Write multiple metrics in one request
curl -XPOST 'http://localhost:8086/write?db=metrics' \
--data-raw '
cpu,host=web01 usage_user=45.2,usage_system=12.1
cpu,host=web02 usage_user=38.7,usage_system=9.3
mem,host=web01 used_percent=72.5
mem,host=web02 used_percent=61.3
'
-- Find hosts with high CPU in the last hour
SELECT host, max(usage_user) as peak_cpu
FROM cpu
WHERE time >= now() - INTERVAL '1 hour'
GROUP BY host
HAVING max(usage_user) > 80
ORDER BY peak_cpu DESC;
Related on TokRepo
- Database tools — database management and query tools
- Monitoring tools — infrastructure monitoring solutions
Common pitfalls
- InfluxDB v1, v2, and v3 have different APIs and query languages; ensure your client library matches your server version
- High-cardinality tag values (like user IDs) can degrade query performance; use fields for high-cardinality data, tags for low-cardinality dimensions
- The line protocol timestamp precision defaults to nanoseconds; sending millisecond timestamps without specifying precision causes incorrect time values
Frequently Asked Questions
InfluxDB v3 is a complete rewrite in Rust using Apache Arrow columnar storage. It adds SQL query support, removes the cardinality limit that constrained v2, and provides much better analytics query performance. v2 uses its own storage engine and the Flux query language.
InfluxDB and Prometheus serve overlapping but different use cases. Prometheus uses a pull-based model and is tightly integrated with Kubernetes. InfluxDB uses a push-based model and supports broader use cases beyond infrastructure monitoring, including IoT and business analytics.
Retention policies define how long data is kept before automatic deletion. You create policies with a specific duration (e.g., 30 days) and assign them to databases. Data older than the retention period is automatically removed by a background process.
InfluxDB provides official client libraries for Python, Go, Java, JavaScript/Node.js, C#, PHP, and Ruby. The v3 API is also compatible with standard PostgreSQL wire protocol clients, so tools like psql and database BI platforms can connect directly.
InfluxDB OSS is free and open source under the Apache 2.0 license. InfluxData also offers InfluxDB Cloud, a managed service with a free tier for low-volume usage and paid tiers for production workloads with higher write and query limits.
Citations (3)
- InfluxDB GitHub— InfluxDB is a scalable time series database rewritten in Rust
- InfluxData Blog— InfluxDB 3.0 uses Apache Arrow columnar storage
- InfluxDB Docs— Line protocol for high-throughput data ingestion
Related on TokRepo
Discussion
Related Assets
WCDB — WeChat Cross-Platform Database Framework
A high-performance, cross-platform database framework developed by WeChat, built on SQLite with ORM, encryption, repair, and migration capabilities.
sql.js — Run SQLite in the Browser with WebAssembly
A JavaScript library that compiles SQLite to WebAssembly, letting you run a full SQL database entirely in the browser or Node.js.
Realm — High-Performance Mobile Database
A fast, object-oriented mobile database designed as a modern replacement for SQLite and Core Data on iOS and Android.