Skip to main content

Module storage

Module storage 

Source
Expand description

§chronix-storage

Pluggable storage backend for the Chronix time-series database.

This module defines the StorageBackend trait that abstracts segment file storage. It has one implementation, ObjectStoreBackend — the cold tier — because the hot path does not go through it: a flush hands an absolute path to SegmentWriter and a read mmaps the file.

It used to have two more, and both were reachable from nowhere. A LocalFsBackend reimplemented the hot path’s file I/O behind the async trait and nothing called it. An EncryptingBackend wrapped any backend in AES-256-GCM and nothing called that either — and because the trait is only implemented by the cold tier, the most it could ever have encrypted is the objects a bucket already encrypts server-side. The documentation described it as Chronix’s encryption at rest, down to a configuration key (storage.encryption.enabled) that has never existed.

§Architecture

Object keys are namespace-scoped and shard-based, for defence-in-depth tenant isolation:

ns_{namespace}/shard_{id}/segment_name.csx

The storage backend is Send + Sync + 'static for use across async tasks.

Re-exports§

pub use backend::SegmentPath;
pub use backend::StorageBackend;
pub use error::StorageError;

Modules§

backend
Storage backend trait and segment path types.
error
Storage backend error types.