Crash-safe, segmented commit log (WAL) for Rust: append-only storage with checksums, index, and efficient iteration.
durable-log is an embeddable write-ahead log that provides:
- Crash safety: recovery by truncating partial/corrupt tail records on open.
- Segmentation: log files roll by size; segments are discovered and opened automatically.
- Checksums: per-record integrity verification.
- Index: fast offset→position lookup with automatic rebuild when missing or corrupt.
- Concurrency: single writer, multiple readers; scans can run while appending.
Use it when you need a simple, reliable, pure-Rust log for event sourcing, durable queues, or replication state. No heavy runtime or external services—just add the crate and point it at a directory.
(API will be expanded as the crate is built.)
use durable_log::Result;
// Open or create a log directory
// let log = durable_log::Log::open("./data")?;
// log.append(b"hello")?;- Single writer: only one process should open the log for writing (enforced via lock file).
- Durability: configurable flush policy (e.g. fsync on append or manual).
- Ordering: offsets are monotonic; recovery preserves consistency up to the last valid record.
Benchmarks and performance notes will be documented as the crate matures. See cargo bench and the Performance section in the docs.
- Crate docs (when published)
- Design docs in
docs/: file format, crash recovery, index layout.
Dual-licensed under MIT OR Apache-2.0. See LICENSE-MIT and LICENSE-APACHE.
See CONTRIBUTING.md. We welcome issues and pull requests.