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, TTL, LRU eviction
- types —
Valueenum withString(Bytes),List(VecDeque<Bytes>),SortedSet(BTreeMap + HashMap dual-index) - memory — per-shard memory tracking and entry size estimation
- expiry — lazy (on access) and active (background sampling) TTL expiration
key types
use ;
// create a 4-shard engine
let engine = new;
// route a GET to the correct shard
let response = engine.route.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 (WIP) |
| ember-cli | interactive command-line client (WIP) |