FluxDB is a production-grade, embeddable time-series database written in pure Rust. No InfluxDB dependency. No RocksDB wrapper. Every byte engineered for speed.
Built with zero external database dependencies. Every subsystem hand-crafted for time-series workloads.
Write-Ahead Log → MemTable → immutable Segment files. Atomic flushes via rename. CRC32 integrity on every segment.
Delta+zigzag+varint for timestamps. Gorilla XOR bit-packing for floats. RLE for repeated values. Auto-selects best codec per column.
SQL-like syntax: SELECT, FROM, WHERE, GROUP BY, EVERY, ORDER BY, LIMIT, OFFSET. 9 aggregate functions including percentile(n).
Arc<Engine> + parking_lot RwLock. Concurrent reads never block writes. Lock-free hot paths via atomic counters.
axum 0.7 server with JSON write, FluxQL query, series listing, health checks, and Prometheus /metrics exposition.
PyO3-based extension module with abi3-py38 stable ABI. Works with Python 3.8 through 3.14+. Full type annotations.
Multi-tier downsampling with background expiry worker. Configurable raw duration, resolution buckets, and total retention windows.
WAL replay on startup. Generation-based rotation with fsync. Binary format with length-prefix framing and CRC32 checksums.
No InfluxDB. No RocksDB. No PostgreSQL. Pure Rust storage engine with hand-crafted segment files and sparse index.
Every layer of the stack is designed to minimize allocations and maximize cache locality.
# Pull and run
docker pull ghcr.io/vignesh2027/fluxdb:latest
docker run -p 8086:8086 -v fluxdb-data:/var/lib/fluxdb ghcr.io/vignesh2027/fluxdb
# Write a data point
curl -X POST http://localhost:8086/write \
-H 'Content-Type: application/json' \
-d '{"measurement":"cpu","tags":{"host":"web01"},"fields":{"usage":72.4}}'
# Query it back
curl -X POST http://localhost:8086/query \
-H 'Content-Type: application/json' \
-d '{"q":"SELECT avg(usage) FROM cpu WHERE host = '\''web01'\''"}'
# Install CLI
cargo install --git https://github.com/vignesh2027/-FLUXDB fluxdb-cli
# Start server
cargo run --release -p fluxdb-server
# In another terminal
fluxdb write cpu --tag host=web01 --field usage=72.4
fluxdb query "SELECT avg(usage) FROM cpu"
fluxdb bench --count 100000
fluxdb series
# Cargo.toml
[dependencies]
fluxdb-core = { git = "https://github.com/vignesh2027/-FLUXDB" }
# main.rs
use fluxdb_core::db::DB;
use fluxdb_core::query::executor::Executor;
use fluxdb_core::types::{SeriesKey, WriteEntry, ts};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let db = DB::open("./data")?;
db.write(
WriteEntry::new(SeriesKey::new("cpu"), ts::now())
.with_field("usage", 72.4)
)?;
let exec = Executor::new(&db);
let result = exec.execute("SELECT avg(usage) FROM cpu")?;
println!("{:?}", result);
Ok(())
}
# Install (requires maturin)
pip install maturin
maturin develop --manifest-path crates/fluxdb-python/Cargo.toml
# Usage
import fluxdb
db = fluxdb.PyDB("./data")
db.write(
"cpu",
fields={"usage": 72.4, "temp": 65.0},
tags={"host": "web01"},
)
result = db.query("SELECT avg(usage) FROM cpu WHERE host = 'web01'")
for series in result.results:
print(f"{series.measurement}: {series.rows[0].fields}")
print(f"Total: {result.total_rows()} rows")
Measured on Apple M3 Pro, 16GB RAM, NVMe SSD.
SELECT value FROM cpu
WHERE time > now() - 1h
ORDER BY time DESC
LIMIT 100
SELECT avg(usage), max(usage)
FROM cpu
WHERE time > now() - 24h
GROUP BY host
EVERY 5m
SELECT sum(bytes)
FROM network
WHERE host = 'web01'
AND interface != 'lo'
AND time > now() - 1h
SELECT
avg(v), mean(v),
sum(v), count(v),
min(v), max(v),
first(v), last(v),
stddev(v),
percentile(v) -- defaults p99
FROM sensors
| Feature | FluxDB | InfluxDB OSS | Prometheus | TimescaleDB |
|---|---|---|---|---|
| Embeddable library | ✅ | ❌ | ❌ | ❌ |
| Pure Rust (no CGO) | ✅ | ✅ (Go) | ✅ (Go) | ❌ (C) |
| Custom storage engine | ✅ | ✅ | ✅ | ❌ (uses PG) |
| Python bindings | ✅ | via HTTP only | client lib | via psycopg2 |
| Single binary | ✅ | ✅ | ✅ | ❌ (PG plugin) |
| Gorilla compression | ✅ | ✅ | ✅ | ✅ |
| Retention policies | ✅ | ✅ | ✅ | ✅ |
| Prometheus /metrics | ✅ | ✅ | native | ✅ |