Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions minikv-core/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,42 @@
//! `minikv_core`
//!
//! Core library for a deterministic, replicated object metadata layer.
//!
//! This crate provides the hashing, volume selection, record encoding,
//! replication, rebuild, and rebalance logic required to maintain
//! a consistent mapping between object keys and storage volumes.
//!
//! The system is designed around the following principles:
//!
//! - Deterministic key β†’ path mapping (`key_to_path`)
//! - Deterministic key β†’ replica selection (`key_to_volume`)
//! - Explicit, auditable record encoding (`Record`)
//! - Metadata recovery from storage volumes (`rebuild_all`)
//! - Convergence to ideal replica placement (`rebalance_all`)
//!
//! The crate does not implement an HTTP server. It focuses strictly on:
//!
//! - Metadata representation and storage abstraction (`MetadataStore`)
//! - Volume interaction primitives (`remote_get`, `remote_put`, etc.)
//! - Replica placement and reconciliation logic
//!
//! All replica selection and ordering is deterministic. Any change to
//! hashing or volume selection logic will change placement and is therefore
//! considered a breaking behavioural change.
//!
//! # High-Level Architecture
//!
//! - `hashing` β€” Key-to-path and volume scoring primitives.
//! - `volumes` β€” Replica selection and rebalance detection.
//! - `record` β€” On-disk metadata encoding format.
//! - `storage` β€” Metadata storage abstraction.
//! - `replication` β€” HTTP primitives for volume interaction.
//! - `rebuild` β€” Metadata reconstruction from volumes.
//! - `rebalance` β€” Migration to ideal replica sets.
//! - `locking` β€” Per-key concurrency control.
//!
//! This crate is intended to be embedded in a higher-level service.

pub mod error;
pub mod hashing;
pub mod locking;
Expand All @@ -10,3 +49,12 @@ pub mod storage;
pub mod volumes;

pub use error::Error;
pub use hashing::{key_to_path, volume_score};
pub use locking::{KeyGuard, KeyLock};
pub use rebalance::{rebalance_all, rebalance_key};
pub use rebuild::{AutoindexEntry, rebuild_all};
pub use record::{Deleted, Record};
pub use replication::{build_volume_client, remote_delete, remote_get, remote_head, remote_put};
pub use state::AppState;
pub use storage::{KeyValuePair, MetadataStore};
pub use volumes::{key_to_volume, needs_rebalance};
Loading