aegis-storage-0.1.7 has been yanked.
aegis-storage
High-performance storage engine for the Aegis Database Platform.
Overview
aegis-storage provides the core storage layer with pluggable backends, write-ahead logging, MVCC transactions, and block-level compression. It serves as the foundation for all data persistence in Aegis.
Features
- Pluggable Backends - Memory and local filesystem backends
- Write-Ahead Logging (WAL) - Durability and crash recovery
- MVCC Transactions - Snapshot isolation with multi-version concurrency control
- Block Compression - LZ4 and Zstd compression support
- Buffer Pool - LRU-based page caching for optimal I/O
Architecture
┌─────────────────────────────────────┐
│ Storage API │
├─────────────────────────────────────┤
│ Transaction Manager (MVCC) │
├─────────────────────────────────────┤
│ Buffer Pool (LRU) │
├─────────────────────────────────────┤
│ Write-Ahead Log (WAL) │
├─────────────┬───────────────────────┤
│ Memory │ Local FS Backend │
│ Backend │ │
└─────────────┴───────────────────────┘
Modules
| Module | Description |
|---|---|
backend |
Storage backend trait and implementations |
block |
Block structure and serialization |
buffer |
Buffer pool with LRU eviction |
page |
Page management and allocation |
transaction |
MVCC transaction handling |
wal |
Write-ahead logging for durability |
Usage
[]
= { = "../aegis-storage" }
Example
use ;
use MemoryBackend;
// Create storage engine with memory backend
let config = default;
let engine = new?;
// Begin a transaction
let tx = engine.begin_transaction?;
// Write data
engine.put?;
// Commit
engine.commit?;
// Read data
let value = engine.get?;
Compression
use ;
// Create compressed block
let block = new
.with_compression;
// Compression is automatic on write
engine.write_block?;
Configuration
[]
= "local" # "memory" or "local"
= "/var/aegis"
= "lz4" # "none", "lz4", "zstd"
= "1GB"
= true
= true
Performance
- Write throughput: ~500K ops/sec (memory backend)
- Read throughput: ~1M ops/sec (cached)
- Compression ratio: 2-10x depending on data
Tests
Test count: 23 tests
License
Apache-2.0