# 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. ## Install Save the content below to `.claude/skills/` or append to your `CLAUDE.md`: ## Quick Use ```bash # Docker docker run -d --name influxdb -p 8086:8086 influxdb:3 # Or binary brew install influxdb # macOS # Setup (v3) influxdb3 create token --permission "*" influxdb3 create database metrics ``` Write data via HTTP line protocol: ```bash 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,usage_system=12.3 $(date +%s)000000000" ``` Query via SQL (InfluxDB 3): ```sql SELECT host, mean(usage_user) as avg_cpu FROM cpu WHERE time >= now() - INTERVAL "1 hour" GROUP BY host ORDER BY avg_cpu DESC; ``` Or InfluxQL (v1/v2 style): ``` SELECT mean("usage_user") FROM "cpu" WHERE time > now() - 1h GROUP BY time(5m), "host" ``` ## Intro InfluxDB is a scalable time series database for metrics, events, and real-time analytics. InfluxDB 3.0 is a complete rewrite in Rust built on Apache Arrow columnar storage (via DataFusion), providing unlimited cardinality, SQL support, and much better analytics performance than v1/v2. Used by Cisco, eBay, IBM, and countless IoT deployments. - **Repo**: https://github.com/influxdata/influxdb - **Stars**: 31K+ - **Language**: Rust - **License**: Apache 2.0 ## What InfluxDB Does - **Time series storage** — optimized for time-ordered data - **High write throughput** — millions of points per second - **Downsampling** — continuous queries / tasks to roll up data - **Retention policies** — auto-delete old data - **SQL + InfluxQL + Flux** — multiple query languages - **Apache Arrow/Parquet** — columnar storage in v3 - **Unlimited cardinality** — v3 removes series cardinality limits - **Telegraf** — 200+ plugins for data collection - **Kapacitor** — alerting and stream processing - **Grafana integration** — first-class data source ## Architecture InfluxDB 3.0 architecture: - **Write** — line protocol to WAL, flushed to Parquet files - **Query** — DataFusion execution engine on Parquet + in-memory WAL - **Storage** — object storage (S3, local disk) for Parquet - **Compactor** — merges small Parquet files into larger ones ## Self-Hosting ```yaml # docker-compose.yml version: "3" services: influxdb: image: influxdb:3-core ports: ["8086:8086"] volumes: ["influx-data:/var/lib/influxdb3"] environment: INFLUXDB3_NODE_IDENTIFIER_PREFIX: "node-1" INFLUXDB3_OBJECT_STORE: "file" INFLUXDB3_DB_DIR: "/var/lib/influxdb3" volumes: influx-data: ``` ## Key Features - Purpose-built for time series - v3 built on Apache Arrow/Parquet - SQL and InfluxQL query - Unlimited cardinality (v3) - High ingest throughput - Downsampling and retention - Telegraf ecosystem (200+ plugins) - Grafana integration - Cloud-native managed offering ## Comparison | Database | Model | Storage | SQL | |---|---|---|---| | InfluxDB v3 | Time series | Parquet + Arrow | Yes + InfluxQL | | TimescaleDB | Postgres extension | Postgres | Native | | Prometheus | Time series | Local TSDB | PromQL only | | VictoriaMetrics | Time series | Custom | MetricsQL | | QuestDB | Time series | Columnar | SQL | | ClickHouse | OLAP | Columnar | SQL | ## FAQ **Q: v2 vs v3 differences?** A: v3 is a complete rewrite (Rust + Apache Arrow/DataFusion), supporting SQL, with no cardinality limits and storage placed on object storage. v2 uses Go + the TSM engine and has cardinality issues. **Q: How do I choose between this and Prometheus?** A: Prometheus is better for monitoring (pull model, simple deployment); InfluxDB is better for general-purpose time series data (push model, SQL queries, longer retention). **Q: Does it support PromQL?** A: v3 has experimental PromQL support, aiming to be a Prometheus alternative. ## Sources - Docs: https://docs.influxdata.com - GitHub: https://github.com/influxdata/influxdb - License: Apache 2.0 --- Source: https://tokrepo.com/en/workflows/influxdb-scalable-time-series-datastore-metrics-events-90136b66 Author: Script Depot