Crate ironwal

Crate ironwal 

Source
Expand description

§IronWal

ironwal is a high-durability, deterministic Write-Ahead Log designed for systems of record such as financial ledgers and game state synchronization.

It prioritizes data integrity, precise replication control, and predictable resource usage.

§Key Features

  • Deterministic Storage: Stream keys map to explicit directories.
  • Hybrid Compression: Frames are compressed (LZ4) or raw based on batch size.
  • Integrity: CRC32 checksums on every frame.
  • Resource Safety: Strict LRU management of open file descriptors.
  • Manual Pruning: Cursor-based truncation for safe replication.

§Example

use ironwal::{Wal, WalOptions};

let wal = Wal::new(WalOptions::default())?;

// Atomic append
let id = wal.append("user_ledger", b"transaction_data")?;

// Batch append
let ids = wal.append_batch("user_ledger", &[b"tx_1", b"tx_2"])?;

Structs§

TxnWriter
A handle for accumulating writes in memory before committing them to disk. Useful for creating atomic batches from distributed logic.
Wal
The main entry point for the IronWal library. Thread-safe and cloneable (internally strictly synchronized).
WalOptions

Enums§

CompressionType
Defines the compression algorithm used for Frame Payloads.
CorruptionPolicy
Policy for handling corrupted data during recovery.
Error
ReadStrategy
Defines the strategy used for reading segment files.
SyncMode
Defines how often the WAL flushes data to the physical disk.

Type Aliases§

Result