Crate grafos_kv

Crate grafos_kv 

Source
Expand description

Key-value store over leased fabric resources.

FabricKvStore provides a tiered key-value store where the hot tier lives in leased DRAM (via FabricHashMap) and the cold tier (behind the persistence feature) spills to leased block storage.

Each key carries a TTL. On access, the TTL is refreshed. The tick() method evicts expired entries. When all keys in the hot tier expire, the backing shard lease can be left to expire naturally, freeing the remote memory.

§Quick start

use grafos_kv::{KvBuilder, FabricKvStore};

let mut kv: FabricKvStore = KvBuilder::new()
    .hot_buckets(64)
    .default_ttl_secs(300)
    .build()?;

kv.put(b"hello", b"world")?;
assert_eq!(kv.get(b"hello")?, Some(b"world".to_vec()));

§Feature flags

FeatureDefaultEffect
stdYesEnables std in grafos-std
persistenceNoEnables cold tier (block storage spill/promote)

Structs§

FabricKvStore
A key-value store backed by leased fabric resources.
KvBuilder
Builder for FabricKvStore.