ScriptsApr 11, 2026·3 min read

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.

TL;DR
InfluxDB stores and queries time-series data at scale with SQL support, high write throughput, and automatic downsampling.
§01

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.

§02

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.

§03

How to use

  1. Run InfluxDB with Docker:
docker run -d --name influxdb -p 8086:8086 influxdb:3
  1. Create a database and token:
influxdb3 create token --permission '*'
influxdb3 create database metrics
  1. 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'
  1. 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;
§04

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;
§05

Related on TokRepo

§06

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

What is the difference between InfluxDB v2 and v3?+

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.

Can InfluxDB replace Prometheus?+

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.

How does retention policy work?+

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.

What client libraries are available?+

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.

Is InfluxDB free to use?+

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)

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets