Skip to main content

Crate aeternusdb

Crate aeternusdb 

Source
Expand description

§AeternusDB

An embeddable, persistent key-value storage engine built on a Log-Structured Merge Tree (LSM-tree) architecture. Designed for fast writes, crash safety, and automatic background compaction.

§Quick Start

use aeternusdb::{Db, DbConfig};

let db = Db::open("/tmp/my_db", DbConfig::default()).unwrap();

// Write
db.put(b"hello", b"world").unwrap();

// Read
assert_eq!(db.get(b"hello").unwrap(), Some(b"world".to_vec()));

// Delete
db.delete(b"hello").unwrap();
assert_eq!(db.get(b"hello").unwrap(), None);

// Scan
db.put(b"a", b"1").unwrap();
db.put(b"b", b"2").unwrap();
let results = db.scan(b"a", b"c").unwrap();
assert_eq!(results.len(), 2);

// Graceful shutdown
db.close().unwrap();

§Features

  • Write-ahead logging — every mutation is persisted before acknowledgement.
  • Automatic compaction — background threads merge SSTables and clean up tombstones.
  • Point and range deletes — efficient tombstone-based deletion.
  • Bloom filters — fast negative lookups on SSTables.
  • CRC32 integrity — all on-disk blocks are checksummed.
  • Crash recovery — automatic recovery from WAL on restart.

Structs§

Db
The main database handle.
DbConfig
Configuration for a Db instance.

Enums§

CompactionStrategyType
Re-export the compaction strategy selector so callers can configure it without reaching into internal modules. Selects which compaction strategy family the engine should use.
DbError
Errors returned by Db operations.

Type Aliases§

KeyValue
A single key-value pair returned by Db::scan.