Top Related Projects
The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
The Prometheus monitoring system and time series database.
An open-source time-series SQL database optimized for fast ingest and complex queries. Packaged as a PostgreSQL extension.
VictoriaMetrics: fast, cost-effective monitoring solution and time series database
Apache Druid: a high performance real-time analytics database.
A scalable, distributed Time Series Database.
Quick Overview
InfluxDB is an open-source time series database designed to handle high write and query loads. It is optimized for storing and analyzing large volumes of timestamped data, making it ideal for monitoring, metrics, and real-time analytics applications.
Pros
- High performance and scalability for time series data
- Flexible data model with tags for efficient querying
- Built-in HTTP API and support for various client libraries
- Continuous queries and retention policies for automated data management
Cons
- Steep learning curve for beginners
- Limited support for complex joins and transactions
- Resource-intensive for large datasets, requiring careful hardware planning
- Community edition lacks some enterprise features like clustering
Code Examples
- Writing data to InfluxDB:
from influxdb_client import InfluxDBClient, Point
from influxdb_client.client.write_api import SYNCHRONOUS
client = InfluxDBClient(url="http://localhost:8086", token="my-token", org="my-org")
write_api = client.write_api(write_options=SYNCHRONOUS)
point = Point("measurement").tag("location", "Prague").field("temperature", 25.3)
write_api.write(bucket="my-bucket", record=point)
- Querying data from InfluxDB:
from influxdb_client import InfluxDBClient
client = InfluxDBClient(url="http://localhost:8086", token="my-token", org="my-org")
query_api = client.query_api()
query = '''from(bucket:"my-bucket")
|> range(start: -1h)
|> filter(fn: (r) => r._measurement == "measurement")
|> mean()'''
result = query_api.query(query=query)
for table in result:
for record in table.records:
print(f"{record.get_value()}")
- Creating a retention policy:
CREATE RETENTION POLICY "one_week" ON "my_database" DURATION 1w REPLICATION 1 DEFAULT
Getting Started
-
Install InfluxDB:
brew update brew install influxdb
-
Start InfluxDB:
influxd
-
Create a bucket:
influx bucket create -n my-bucket -o my-org -r 7d
-
Write data using the InfluxDB CLI:
influx write -b my-bucket -o my-org -p s 'measurement,tag=value field=1.0'
-
Query data:
influx query 'from(bucket:"my-bucket") |> range(start: -1h) |> filter(fn: (r) => r._measurement == "measurement")'
Competitor Comparisons
The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
Pros of Grafana
- More versatile visualization options and dashboard customization
- Supports multiple data sources, not limited to time-series databases
- Larger community and ecosystem with extensive plugin support
Cons of Grafana
- Steeper learning curve for advanced features and customizations
- Requires separate data storage solution, adding complexity to setup
Code Comparison
InfluxDB query example:
SELECT mean("value") FROM "measurement" WHERE time >= now() - 1h GROUP BY time(5m)
Grafana query example (using InfluxDB data source):
SELECT mean("value") FROM "measurement" WHERE $timeFilter GROUP BY time($__interval)
Both InfluxDB and Grafana are powerful tools in the data visualization and monitoring space. InfluxDB is primarily a time-series database with built-in visualization capabilities, while Grafana is a dedicated visualization and monitoring platform that can work with various data sources.
InfluxDB excels in time-series data storage and querying, offering a simpler setup for projects focused on time-series data. Grafana, on the other hand, provides more flexibility in data visualization and supports a wider range of data sources, making it suitable for diverse monitoring needs.
The choice between the two depends on specific project requirements, with InfluxDB being ideal for time-series-centric applications and Grafana offering more versatility for complex monitoring scenarios.
The Prometheus monitoring system and time series database.
Pros of Prometheus
- Built-in alerting system with Alertmanager
- Powerful query language (PromQL) for data analysis
- Native support for multi-dimensional data and labels
Cons of Prometheus
- Limited long-term storage options
- Pull-based model may not suit all use cases
- Steeper learning curve for complex setups
Code Comparison
Prometheus query example:
rate(http_requests_total{job="api-server"}[5m])
InfluxDB query example:
SELECT mean("value") FROM "http_requests" WHERE ("job" = 'api-server') AND time >= now() - 5m GROUP BY time(1m)
Key Differences
- Data Model: Prometheus uses a multi-dimensional data model with labels, while InfluxDB uses a time-series data model with tags and fields.
- Query Language: Prometheus uses PromQL, InfluxDB uses InfluxQL (SQL-like) or Flux.
- Data Collection: Prometheus primarily uses a pull model, InfluxDB supports both push and pull.
- Scalability: InfluxDB offers better horizontal scalability for large deployments.
- Use Cases: Prometheus is often preferred for monitoring and alerting, while InfluxDB is more versatile for various time-series data applications.
Both Prometheus and InfluxDB are powerful time-series databases with their own strengths. The choice between them depends on specific project requirements, existing infrastructure, and team expertise.
An open-source time-series SQL database optimized for fast ingest and complex queries. Packaged as a PostgreSQL extension.
Pros of TimescaleDB
- Built on PostgreSQL, offering full SQL support and compatibility with existing tools
- Optimized for time-series data with automatic partitioning and indexing
- Supports both relational and time-series data in a single database
Cons of TimescaleDB
- Steeper learning curve for users not familiar with PostgreSQL
- May require more manual configuration for optimal performance
- Limited built-in visualization tools compared to InfluxDB
Code Comparison
TimescaleDB (SQL):
CREATE TABLE sensors (
time TIMESTAMPTZ NOT NULL,
sensor_id INTEGER,
temperature DOUBLE PRECISION,
humidity DOUBLE PRECISION
);
SELECT time_bucket('1 hour', time) AS hour,
AVG(temperature) AS avg_temp
FROM sensors
WHERE time > NOW() - INTERVAL '24 hours'
GROUP BY hour
ORDER BY hour;
InfluxDB (InfluxQL):
CREATE DATABASE sensors
INSERT temperature,sensor_id=1 value=25.5
INSERT humidity,sensor_id=1 value=60.0
SELECT MEAN(temperature) AS avg_temp
FROM sensors
WHERE time > NOW() - 24h
GROUP BY time(1h)
Both databases offer powerful time-series data management capabilities, but TimescaleDB provides stronger SQL support and relational data handling, while InfluxDB offers a more streamlined experience for pure time-series workloads.
VictoriaMetrics: fast, cost-effective monitoring solution and time series database
Pros of VictoriaMetrics
- Higher performance and better resource efficiency
- Simpler architecture and easier maintenance
- Native support for multi-tenancy and high cardinality data
Cons of VictoriaMetrics
- Less mature ecosystem and community support
- Fewer built-in data visualization tools
- Limited support for complex queries and analytics
Code Comparison
InfluxDB query example:
SELECT mean("value") FROM "cpu" WHERE "host" = 'server01' AND time >= now() - 1h GROUP BY time(5m)
VictoriaMetrics query example:
SELECT avg(value) FROM cpu WHERE host='server01' AND timestamp >= now() - 1h GROUP BY time(5m)
Both databases use SQL-like query languages, but VictoriaMetrics supports PromQL-style queries as well:
avg_over_time(cpu{host="server01"}[1h])
VictoriaMetrics generally offers simpler syntax for complex queries and better performance for high-cardinality data. However, InfluxDB provides a more comprehensive set of built-in functions and a more mature ecosystem of tools and integrations.
While InfluxDB is often considered the industry standard for time-series databases, VictoriaMetrics is gaining popularity due to its performance advantages and simpler architecture, especially for large-scale deployments and high-cardinality use cases.
Apache Druid: a high performance real-time analytics database.
Pros of Druid
- Better suited for high-concurrency, low-latency analytics queries on large datasets
- Supports real-time ingestion and querying of data simultaneously
- More flexible data model, allowing for nested data structures
Cons of Druid
- More complex setup and configuration compared to InfluxDB
- Higher resource requirements, especially for smaller datasets
- Steeper learning curve for new users
Code Comparison
InfluxDB query example:
SELECT mean("value") FROM "measurement"
WHERE "tag" = 'example'
AND time >= now() - 1h
GROUP BY time(5m)
Druid query example:
{
"queryType": "timeseries",
"dataSource": "measurement",
"intervals": ["2023-01-01/2023-01-02"],
"granularity": "five_minute",
"aggregations": [{"type": "doubleSum", "name": "value", "fieldName": "value"}],
"filter": {"type": "selector", "dimension": "tag", "value": "example"}
}
Both InfluxDB and Druid are powerful time-series databases, but they have different strengths. InfluxDB is generally easier to set up and use, making it a good choice for simpler time-series data storage and querying. Druid excels in scenarios requiring real-time analytics on large datasets with high concurrency. The choice between the two depends on specific use cases and requirements.
A scalable, distributed Time Series Database.
Pros of OpenTSDB
- Built on top of HBase, providing excellent scalability for large-scale time series data
- Supports high cardinality data with efficient storage and retrieval
- Offers flexible querying capabilities with powerful aggregation functions
Cons of OpenTSDB
- Steeper learning curve and more complex setup compared to InfluxDB
- Less active development and community support
- Limited built-in visualization and dashboarding options
Code Comparison
OpenTSDB query example:
http://example.com/api/query?start=1h-ago&m=sum:cpu.load{host=*}
InfluxDB query example:
SELECT mean("value") FROM "cpu_load" WHERE time >= now() - 1h GROUP BY "host"
OpenTSDB uses a URL-based query format, while InfluxDB employs a SQL-like query language. InfluxDB's syntax is generally more intuitive for users familiar with SQL.
Both databases offer powerful time series data management capabilities, but InfluxDB provides a more user-friendly experience with its built-in tools and active community. OpenTSDB excels in scenarios requiring extreme scalability and high cardinality data handling, leveraging HBase's distributed architecture. The choice between the two depends on specific use cases, existing infrastructure, and team expertise.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
InfluxDB is the leading open source time series database for metrics, events, and real-time analytics.
Project Status
This main branch contains InfluxDB v3 in pre-release and under active development. Build artifacts are not yet generally available and official installation instructions will be coming later this year. For now, a Dockerfile is provided and can be adapted or used for inspiration by intrepid users.
Learn InfluxDB
Documentation | Community Forum | Community Slack | Blog | InfluxDB University | YouTube
Try InfluxDB Cloud for free and get started fast with no local setup required. Click here to start building your application on InfluxDB Cloud.
Installation
We have nightly and versioned Docker images, Debian packages, RPM packages, and tarballs of InfluxDB available on the InfluxData downloads page. We also provide the InfluxDB command line interface (CLI) client as a separate binary available at the same location.
- For v1 installation, use the main 1.x branch or install InfluxDB OSS directly.
- For v2 installation, use the main 2.x branch.
- v3 development is on this main branch. This project is actively under development and is not considered stable.
If you are interested in building from source, see the building from source guide for contributors.
To begin using InfluxDB, visit our Getting Started with InfluxDB documentation.
License
The open source software we build is licensed under the permissive MIT and Apache 2 licenses. Weâve long held the view that our open source code should be truly open and our commercial code should be separate and closed.
Interested in joining the team building InfluxDB?
Check out current job openings at www.influxdata.com/careers today!
Top Related Projects
The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
The Prometheus monitoring system and time series database.
An open-source time-series SQL database optimized for fast ingest and complex queries. Packaged as a PostgreSQL extension.
VictoriaMetrics: fast, cost-effective monitoring solution and time series database
Apache Druid: a high performance real-time analytics database.
A scalable, distributed Time Series Database.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot