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 |
#61 in Caching
1.5MB
30K
SLoC
ember-server
the main server binary for ember. accepts TCP connections, parses RESP3 commands, routes them through the sharded engine, and writes responses back. supports pipelining and graceful shutdown.
what's in here
- main — CLI arg parsing (host, port, max-memory, eviction policy, persistence, metrics, slowlog config)
- server — TCP accept loop with configurable connection limits, graceful shutdown on SIGINT/SIGTERM, spawns a handler task per client
- connection — per-connection event loop: read → parse frames → dispatch commands → write responses. handles idle timeouts, buffer limits, and protocol errors. renders multi-section INFO and handles SLOWLOG commands
- config — configuration helpers for byte sizes, eviction policies, fsync policies
- metrics — prometheus exporter, per-command histogram/counter recording, background stats poller
- slowlog — ring buffer for slow command logging with configurable threshold and capacity
running
# basic — listens on 127.0.0.1:6379, no persistence
cargo run --release -p ember-server
# with memory limit and LRU eviction
cargo run --release -p ember-server -- --max-memory 256M --eviction-policy allkeys-lru
# with AOF persistence
cargo run --release -p ember-server -- --data-dir ./data --appendonly --appendfsync everysec
# with prometheus metrics on port 9100
cargo run --release -p ember-server -- --metrics-port 9100
# with encryption at rest (requires --features encryption)
cargo run --release -p ember-server --features encryption -- \
--data-dir ./data --appendonly --encryption-key-file /path/to/keyfile
compatible with redis-cli and any RESP3 client.
related crates
| crate | what it does |
|---|---|
| emberkv-core | storage engine, keyspace, sharding |
| ember-protocol | RESP3 parsing and command dispatch |
| ember-persistence | AOF, snapshots, and crash recovery |
| ember-cluster | distributed coordination |
| ember-cli | interactive CLI client (REPL, cluster subcommands, benchmark) |
Dependencies
~25–45MB
~665K SLoC