Crate rskv

Crate rskv 

Source
Expand description

§rskv: A High-Performance Key-Value Store in Rust

rskv is a high-performance, concurrent, persistent key-value store inspired by Microsoft’s FASTER. It leverages modern Rust features for safety and performance.

§Core Features

  • Hybrid Storage Engine: Combines in-memory hot data with disk-backed log
  • Concurrent Hash Index: Lock-free hash index for fast key lookups
  • Non-Blocking Checkpoints: Consistent snapshots without pausing operations
  • Epoch-Based Garbage Collection: Safe background space reclamation

§Example

use rskv::{RsKv, Config};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let config = Config::default();
    let kv_store = RsKv::new(config).await?;
     
    let key = b"hello".to_vec();
    let value = b"world".to_vec();
     
    kv_store.upsert(key.clone(), value).await?;
    let result = kv_store.read(&key).await?;
     
    println!("Value: {:?}", result);
    Ok(())
}

Re-exports§

pub use background::BackgroundTaskManager;
pub use background::BackgroundTaskStats;
pub use checkpoint::CheckpointMetadata;
pub use checkpoint::CheckpointState;
pub use checkpoint::CheckpointStats;
pub use common::Address;
pub use common::Config;
pub use common::Key;
pub use common::Result;
pub use common::RsKvError;
pub use common::Value;
pub use epoch::EpochHandle;
pub use epoch::EpochManager;
pub use epoch::SharedEpochManager;
pub use gc::GcConfig;
pub use gc::GcEstimate;
pub use gc::GcState;
pub use gc::GcStats;
pub use metrics::MetricsCollector;
pub use metrics::MetricsSnapshot;
pub use metrics::SharedMetricsCollector;
pub use metrics::new_shared_metrics_collector;
pub use rskv::RsKv;
pub use rskv::RsKvStats;

Modules§

background
Background task management for rskv
checkpoint
Checkpoint and recovery implementation for rskv
common
Common types and error definitions for rskv
epoch
Epoch-based memory management for rskv
gc
Garbage collection implementation for rskv
hlog
Hybrid Log (HLog) implementation for rskv
index
Concurrent hash index implementation for rskv
metrics
Performance metrics collection for rskv
rskv
Main RsKv key-value store implementation