Expand description
§Chronix
The embedded-first time-series database with analytics built in.
One dependency gives you a crash-safe, columnar time-series engine with
SQL (DataFusion), PromQL, forecasting and anomaly detection — in
process, no server, no sidecar. The same engine runs as the chronixd
server behind Grafana, Prometheus and Telegraf.
§Quick start
use chronix::prelude::*;
let db = Chronix::open_small("/tmp/mydb")?;
let key = SeriesKey::new("cpu", tags! { "host" => "server-01" })?;
let point = Point::new(key, fields! { "usage" => 95.5 }, 1_700_000_000_000_000_000)?;
db.insert(&point)?;
for batch in db.sql("SELECT host, avg(usage) FROM cpu GROUP BY host")? {
println!("{batch:?}");
}
db.close()?;§Where things are
Chronix— open, insert, query,sql, forecast, rollups, retention, backup. A cheap-to-clone handle.prelude— the types and macros a typical program needs.sql,promql— the two query languages, for callers that want more thanChronix::sqlandChronix::promqloffer.rollup,retention,export,pipeline— background work and interop.- The engine crates are re-exported under their own names
(
chronix_core,chronix_engine,chronix_query,chronix_analytics,chronix_streaming,chronix_security,chronix_encoding) for advanced use.
§Stability
Three tiers, and the difference matters when a dependency bumps:
Chronix,preludeand the types they name — the supported surface. Arrow’sRecordBatchis the only third-party type in it, and deliberately so: a columnar database that hides its batches is a database you cannot stream out of.sqlandpromql— for callers who want more thanChronix::sqlandChronix::promqloffer.sqltakes and returnsDataFusiontypes, so it moves whenDataFusiondoes.- The re-exported engine crates — no promise beyond their own.
Within 0.x none of this is frozen; a breaking change bumps the minor
(CONTRIBUTING.md). public_api pins the tier-1 surface so that a change
to it is a deliberate edit rather than a side effect.
What actually changed in a release is in the
changelog.
The link is absolute and it is here, on the crate’s own front page,
because this is the page a reader lands on after cargo update moved
them a minor version. There is one changelog and it lives at the
repository root: cargo package includes nothing from outside a package
directory, so a copy inside this crate would be a second changelog to
keep true rather than a copy that stays true.
Re-exports§
pub use analytics::AnomalyConfig;pub use analytics::ForecastConfig;pub use db::BackupManifest;pub use db::Chronix;pub use db::DatabaseStatistics;pub use db::SegmentInfo;pub use delete::DeleteBuilder;pub use delete::DeleteOutcome;pub use delete::DeleteRequest;pub use error::DbError;pub use error::InsertResult;pub use export::ParquetCompression;pub use export::ParquetExportConfig;pub use pipeline::Pipeline;pub use pipeline::PipelineConfig;pub use rollup::RollupAggFn;pub use rollup::RollupBuilder;pub use rollup::RollupConfig;pub use rollup::RollupRegistry;pub use rollup::RollupState;pub use chronix_analytics;pub use chronix_core;pub use chronix_encoding;pub use chronix_engine;pub use chronix_query;pub use chronix_security;pub use chronix_streaming;
Modules§
- analytics
- Analytics configuration types for the Rust API. Configuration types for the Chronix analytics Rust API.
- cold_
archive - Archiving cold data to object storage.
- db
- The
Chronixdatabase handle — open, write, query, close lifecycle. - delete
- Fluent delete builder for predicate-based deletes.
- error
- Unified error type for the Chronix embedded database.
- export
- Parquet export — converts Chronix segments to Apache Parquet files.
- macros
- Convenience macros for building tags and fields.
- pipeline
- Real-time analytics pipeline — orchestrates CDC → Signal, Analytics, Authz, and Audit.
- prelude
- Everything a typical program needs:
use chronix::prelude::*;. - promql
PromQLquery engine for Chronix.- retention
- Retention enforcer — automatically drops shards older than the retention period.
- rollup
- Rollup configuration, the streaming bucket accumulator, and the materialisation watermarks.
- sql
- SQL query engine powered by Apache
DataFusion.