Embedded
A library, not a deployment. File-locked data directory, crash-safe WAL, graceful close(), no background daemons required. Runs where a database server cannot — a 512 MB gateway, a desktop app, a test.
use chronix::prelude::*;
// Gateway preset: under 25 MiB peak heap measured for ingest and rollups,
// flash-friendly WAL.
let db = Chronix::open_small("/var/lib/chronix")?;
db.insert(&Point::new(
SeriesKey::new("power", tags! { "meter" => "main" })?,
fields! { "watts" => 231.45 },
1_700_000_000_000_000_000,
)?)?;
// Forecasting is a method on the database, not another service —
// and the model is chosen by cross-validation, not by you.
let chosen = db.auto_forecast(
"power", "watts", &[("meter", "main")],
start, end, 24 * 60, None,
)?;
println!("{}", chosen.selection.label); // e.g. SARIMA(1,0,0)(0,1,1)[24]
Server
chronixd speaks the protocols your tools already emit: InfluxDB line protocol, Prometheus remote write/read, full PromQL, OTLP metrics and Arrow Flight SQL. Point Grafana at it and it behaves like a Prometheus data source.
chronixd --data-dir /var/lib/chronix
# InfluxDB line protocol — Telegraf can write here unchanged
curl -X POST localhost:8086/write \
--data-binary 'power,meter=main watts=231.45'
# PromQL — the same request Grafana sends a Prometheus data source
curl 'localhost:8086/api/v1/query?query=rate(power_watts[5m])'