aiondb-storage-engine

The default storage backend. Implements the StorageDDL, StorageDML, StorageTxnParticipant, and StorageCapabilities traits from aiondb-storage-api on top of WAL, the buffer pool, an LSM SSTable layer, and an HNSW vector index. Owns table heap data, B-Tree and HNSW secondary indexes, GIN indexes, adjacency indexes for graph edges, and the paged-snapshot stores used at checkpoint time. Recovery replays WAL records into this state at startup.

cargo

[dependencies]
aiondb-storage-engine = { path = "../aiondb-storage-engine" }

modules

The crate exposes a single public surface from lib.rs. The internal engine, backend, layout, lsm_sstable, and replication modules are not directly re-exported; their public types are surfaced through the items listed below.

key types

typerole
StorageEnginetype alias for InMemoryStorage; the engine entry point.
InMemoryStoragethe storage backend; holds tables, indexes, WAL integration, paged snapshot stores.
StorageOptionsfull configuration: WAL config, commit policy, memory limit, paged root dir, snapshot mirror, checkpoint manifest dir, eviction threshold, WAL retention.
StorageBufferPoolConfigframe counts for the table, snapshot, and index buffer pools.
WalCommitPolicyAlways, Every(N), or Never.
RecoveryReport, RecoveredStatisticsreplay output and per-table statistics recovered from WAL.
StorageMetricsruntime counters surfaced by the engine.
HnswIndexStats, HnswSearchStats, HnswSearchStatsSummaryvector-index statistics.
StorageBackendKind, StorageBackendSpec, StorageBackendHandlebackend selection (InMemory, Durable, Disk, PageEngine, Lsm).
DiskBackendConfig, DiskSyncPolicydirect-disk backend tuning.
PageEngineBackendConfig, PageSyncPolicybuffer-pool-backed page engine tuning.
LsmBackendConfigLSM-tree backend tuning.
DiskTableStore, DiskTableStoreConfigdisk-resident heap store.
RowLockTable, RowLockMode, IntentLockMode, DmlPrecheckrow-level lock manager.
StorageReplicationSeedManifestmanifest describing a replication seed installed by install_replication_seed.
install_replication_seedinstall an exported seed (storage state + manifest) into a target data dir. Used by aiondb-engine when seeding a fresh replica with a non-empty catalog.
doctor_data_dir / StorageDoctorReportinspect a data dir without opening it; surfaces format version, stable artefacts, WAL segments, snapshots, page-file kinds, and detected experimental files. Backs the aiondb doctor subcommand.
upgrade_data_dirback up the data dir, then write the current storage manifest. Backs the aiondb upgrade subcommand.
ensure_storage_contract_for_opencalled by the engine builder before opening a persistent backend. Writes the manifest into a fresh data dir; rejects existing dirs that contain stable artefacts but no manifest.
PageStoreStoragetype alias for StorageEngine. Kept for legacy callers that referred to the page-store-backed storage by name.
WalConfig, WalLsnModere-exported from aiondb-wal for convenience.

constructors

constructoruse
StorageEngine::new(StorageOptions)WAL-backed engine with full durability.
StorageEngine::new_without_wal()non-durable in-memory engine.
StorageEngine::new_without_wal_with_memory_limit(limit)non-durable, with a memory cap.

example

use aiondb_storage_engine::{StorageEngine, StorageOptions, WalCommitPolicy};
use aiondb_wal::WalConfig;

let options = StorageOptions {
    wal_config: WalConfig {
        dir: "/var/lib/aiondb/wal".into(),
        ..Default::default()
    },
    wal_commit_policy: WalCommitPolicy::Always,
    ..StorageOptions::durable(WalConfig::default())
};

let _engine = StorageEngine::new(options).expect("open storage engine");