| Crates.io | mace-kv |
| lib.rs | mace-kv |
| version | 0.0.25 |
| created_at | 2025-11-17 04:21:29.034968+00 |
| updated_at | 2026-01-23 13:47:24.602665+00 |
| description | A fast, cross-platform embedded key-value storage engine with ACID, MVCC, and flash-optimized storage |
| homepage | https://github.com/abbycin/mace |
| repository | https://github.com/abbycin/mace |
| max_upload_size | |
| id | 1936234 |
| size | 571,536 |
Mace is a high-performance, embedded key-value storage engine written in Rust. It is designed to combine the predictable read performance of B+ Trees with the high write throughput of LSM Trees.
Built for modern storage hardware, Mace employs a flash-optimized log-structured architecture and implements Key-Value separation (Blob storage) to minimize write amplification and compaction overhead.
Add mace-kv to your Cargo.toml:
cargo add mace-kv
The following example demonstrates basic transaction management and data retrieval:
use mace::{Mace, OpCode, Options};
fn main() -> Result<(), OpCode> {
// 1. Initialize the storage
let opts = Options::new("./data_dir");
let db = Mace::new(opts.validate().unwrap())?;
// 2. Perform a write transaction
let txn = db.begin()?;
txn.put("user:1", "alice")?;
txn.put("user:2", "bob")?;
txn.commit()?;
// 3. Read data using a consistent view
let view = db.view()?;
let value = view.get("user:1")?;
println!("Value for user:1: {:?}", std::str::from_utf8(value.slice()));
// 4. Remove data
let txn = db.begin()?;
txn.del("user:2")?;
txn.commit()?;
Ok(())
}
Detailed usage can be found in examples/demo.rs.
Mace is engineered for heavy workloads. For detailed performance analysis and comparison with other engines, refer to the kv_bench repository.
Mace is currently in early development. While the core engine is stable for testing, the storage format and API are subject to change until the 1.0 release. It is recommended to perform thorough testing before using it in critical production systems.
This project is licensed under the MIT License - see the LICENSE file for details.