4 releases (breaking)
Uses new Rust 2024
| 0.4.0 | Feb 5, 2026 |
|---|---|
| 0.3.0 | Feb 4, 2026 |
| 0.2.0 | Jan 18, 2026 |
| 0.1.0 | Jan 17, 2026 |
#5 in #tree-index
Used in 2 crates
55KB
1K
SLoC
apfsds-storage
MVCC storage engine with WAL persistence for APFSDS.
Features
- MVCC Engine: Multi-version concurrency control for consistent reads
- Log-structured Segments: Append-only segments with efficient compaction
- Write-Ahead Log (WAL): Durability with crash recovery
- B-link Tree Index: Fast key lookups
- ClickHouse Backup: Async batch export to ClickHouse for analytics
Usage
use apfsds_storage::{StorageEngine, StorageConfig};
let config = StorageConfig {
disk_path: "/var/lib/apfsds".into(),
segment_size: 64 * 1024 * 1024, // 64MB
compaction_threshold: 4,
};
let engine = StorageEngine::open(config)?;
// Write
engine.put(b"key", b"value").await?;
// Read
let value = engine.get(b"key").await?;
// Scan range
for (k, v) in engine.scan(b"a"..b"z").await? {
println!("{:?} = {:?}", k, v);
}
Architecture
┌─────────────┐
│ API │
├─────────────┤
│ MVCC │ ← Version management
├─────────────┤
│ Segments │ ← Log-structured storage
├─────────────┤
│ WAL │ ← Write-ahead log
└─────────────┘
License
MIT
Dependencies
~48–68MB
~1M SLoC