๐ก๏ธ FerrumDB
FerrumDB is a premium, high-performance local key-value database built in Rust. Designed for developers who need a reliable, "zero-setup" structured data store that feels as fast as a cache but is as durable as a disk-backed database.
๐ Why FerrumDB?
- โก Append-Only Architecture (AOF): $O(1)$ write performance. We never overwriteโwe only grow.
- ๐ฆ Structured Data: Native support for JSON Values. Store objects, arrays, and numbers directly.
- โณ Time-To-Live (TTL): Built-in data expiration for efficient local caching.
- ๐งน Background Compaction: Automatic garbage collection to keep your storage footprint minimal.
- ๐๏ธ Embeddable Library: Use it as a CLI tool or import it as a high-level Rust crate.
- ๐ก๏ธ Crash Resilient: Atomic swaps and
sync_dataguarantee your data survives power loss.
๐ Quick Start
Library Usage (Zero-Setup)
Add FerrumDB to your project and start storing data in seconds:
use FerrumDB;
use json;
async
CLI Interactive REPL
Experience the premium terminal interface with autocomplete and syntax highlighting:
๐ ๏ธ Commands Reference
| Command | Usage | Description |
|---|---|---|
| SET | SET <key> <json> |
Store structured data (Strings, Objects, Arrays) |
| GET | GET <key> |
Retrieve and pretty-print stored data |
| DELETE | DELETE <key> |
Remove a key-value pair |
| KEYS | KEYS |
List all indexed keys |
| COUNT | COUNT |
Show total number of entries |
| COMPACT | COMPACT |
Manually trigger log file optimization |
| HELP | HELP |
Show commands and session metrics |
๐จ Premium REPL Features
- Tab-Complete: Instantly complete commands and keys.
- Colorized Output: High-contrast, easy-to-read terminal feedback.
- JSON Pretty-Print: Structured output for complex data.
๐ Architecture
- Engine: Bitcask-lite inspired log-structured storage.
- Index: In-memory
HashMapleveragingtokio::sync::RwLockfor high concurrency. - Persistence: Binary serialization via
bincodefor maximum speed and minimal disk usage.
๐ License
Distributed under the MIT License. See LICENSE for more information.