Chronix

Embedded time-series database · Rust

The time-series database you add with Cargo.

Chronix runs inside your binary — on a 512 MB gateway or behind Grafana — and stores exact decimals, forecasts demand and detects anomalies.
  • cargo add chronix
  • brew install hupe1980/tap/chronixd && chronixd --demo
use chronix::prelude::*;

// The gateway preset: small memory budgets, serial reads.
let db = Chronix::open_small("/var/lib/chronix")?;
let t = 1_700_000_000_000_000_000; // ns since the epoch

let key = SeriesKey::new("power", tags! { "meter" => "main" })?;
db.insert(&Point::new(key, fields! { "watts" => 231.45 }, t)?)?;

// PromQL, in-process. No server.
let power = db.promql("power_watts", t)?;

One engine, from the gateway to Grafana

Use the Rust library for local queries and forecasts, or run the same database behind Grafana.

In your binary

under 25 MiBpeak heap for an hour of gateway ingest and rollups

Store readings in a local directory with a crash-safe WAL. Background maintenance builds rollups and enforces retention.

Run it on a gateway

Analytics in the engine

ARIMA · ETS · CUSUMmatched against statsmodels and scipy

Forecasting with calibrated intervals, anomaly detection, and detectors you declare once — persisted and advanced by the store like a rollup. Callable from Rust, SQL and PromQL-backed dashboards.

Forecast and detect

Exact where it matters

475×compression on decimal meter data

A Decimal type with the scale on the column, exact through the WAL, every wire format and every aggregate. Pcodec recovers the integer behind a float: 5–29× on realistic sensor data.

The data model

Speaks your protocols

PromQL · OTLP · Influx · Flighttested with the bytes real clients send

Prometheus remote write and read with native histograms, OpenTelemetry metrics, InfluxDB line protocol and Arrow Flight SQL. Point Grafana at it as a Prometheus data source.

Send data

Or run it as a server

chronixd is the same engine and the same file format behind an HTTP, gRPC and Flight SQL front. The tools you already run — Prometheus, Telegraf, the OpenTelemetry Collector, Grafana — talk to it without a plugin.

Connect Grafana
# InfluxDB line protocol: Telegraf writes here unchanged
curl localhost:8086/write \
  --data-binary 'power,meter=main watts=231.45'

# PromQL: what Grafana's Prometheus data source sends
curl localhost:8086/api/v1/query \
  --data-urlencode 'query=power_watts'

# SQL: forecasting is an aggregate
curl localhost:8086/api/v1/chronix/sql \
  -H 'content-type: application/json' -d '{"query":
  "SELECT unnest(forecast(watts, _time, 24)) FROM power"}'

Chronix runs on a single node. See the cluster reference for the frozen distributed tier.

Esc