Skip to main content

Module objstore

Module objstore 

Source
Expand description

Object storage backend for Chronix.

Provides cloud-compatible segment storage (S3, GCS, Azure Blob Storage) implementing the crate::storage::StorageBackend trait, with an optional local disk cache for frequently accessed segments.

§Quick Start

use chronix_engine::objstore::{ObjectStoreBackend, ObjectStoreConfig};
use chronix_engine::storage::StorageBackend;

// S3 backend with 1 GB local cache
let config = ObjectStoreConfig {
    url: "s3://my-bucket/chronix-data".into(),
    cache: Some(crate::objstore::CacheConfig {
        cache_dir: "/tmp/chronix-cache".into(),
        max_size_bytes: 1024 * 1024 * 1024,
    }),
    multipart_threshold_bytes: 8 * 1024 * 1024, // 8 MiB
    max_concurrent_downloads: 8,
};

let backend = ObjectStoreBackend::new(config).await?;

// Use it like any StorageBackend
let path = crate::storage::SegmentPath::new(
    chronix_core::NamespaceId::default_namespace(),
    chronix_core::ShardId(1),
    "seg_001.csx",
)?;
backend.put_segment(&path, b"segment data").await?;

§URL Schemes

SchemeBackendExample
s3://Amazon S3s3://bucket/prefix
gs://Google Cloudgs://bucket/prefix
az://Azure Blob Storageaz://container/prefix
file://Local filesystemfile:///tmp/data
memory://In-memory (tests)memory://test
/pathLocal filesystem/tmp/data

Re-exports§

pub use backend::BackoffConfig;
pub use backend::ObjectStoreBackend;
pub use backend::ObjectStoreConfig;
pub use cache::CacheConfig;
pub use cache::DiskCache;
pub use error::ObjStoreError;
pub use error::Result;
pub use parquet_tier::ParquetArchiveWriter;
pub use parquet_tier::parquet_to_batches;
pub use tiering::ArchiveObject;
pub use tiering::TieringConfig;
pub use tiering::TieringEngine;

Modules§

backend
Object storage backend wrapping the object_store crate.
cache
Local disk cache with LRU eviction for object store data.
error
Object storage error types.
parquet_tier
Parquet encoding for the cold tier.
tiering
Cold-storage archival: uploading an encoded archive object and verifying it landed.