14 unstable releases (3 breaking)
| new 0.4.4 | Feb 16, 2026 |
|---|---|
| 0.4.3 | Feb 11, 2026 |
| 0.3.1 | Feb 8, 2026 |
| 0.2.3 | Feb 7, 2026 |
| 0.1.4 | Feb 6, 2026 |
#733 in Caching
Used in ember-server
1MB
22K
SLoC
emberkv-core
the storage engine for ember. owns the keyspace, data types, sharding, expiration, and memory management.
this is the heart of ember — it implements the shared-nothing, shard-per-core architecture where each shard independently manages a partition of keys with no cross-thread synchronization on the hot path.
what's in here
- engine — routes requests to shards by key hash, supports single-key, multi-key, and broadcast operations
- shard — the single-threaded event loop per partition: dispatch, AOF recording, expiration ticks, fsync ticks
- keyspace — the key-value store itself: strings, lists, sorted sets, hashes, sets, TTL, LRU eviction
- types —
Valueenum withString(Bytes),List(VecDeque<Bytes>),SortedSet(BTreeMap + HashMap dual-index),Hash(HashMap),Set(HashSet) - memory — per-shard memory tracking and entry size estimation
- expiry — lazy (on access) and active (background sampling) TTL expiration
key types
use ember_core::{Engine, EngineConfig, ShardRequest, ShardResponse};
// create a 4-shard engine
let engine = Engine::new(4);
// route a GET to the correct shard
let response = engine.route("mykey", ShardRequest::Get {
key: "mykey".into(),
}).await?;
related crates
| crate | what it does |
|---|---|
| ember-protocol | RESP3 parsing and command dispatch |
| ember-persistence | AOF, snapshots, and crash recovery |
| ember-server | TCP server and connection handling |
| ember-cluster | distributed coordination |
| ember-cli | interactive CLI client (REPL, cluster subcommands, benchmark) |
Dependencies
~14–20MB
~260K SLoC