feltdb
An embedded, durable state store for Rust. Records live in an append-only log on local disk. Several records can change in one atomic transaction, a write can be conditional on the version you read, and a transaction can carry an identity so that a retry after an uncertain outcome is recognized instead of applied twice.
[]
= "0.2"
= "1"
use ;
use json;
The crate documentation on docs.rs has a longer, tested example covering atomic transactions and safe retries.
What you can rely on
- Acknowledged writes and committed transaction ids survive closing and reopening the database, and a process kill.
- An interrupted, unacknowledged append is discarded on open and reported; its retry is treated as a first use.
- A transaction id names one payload. Reusing an id with a different payload hash fails with
FlowError::TransactionIdPayloadMismatchand writes nothing.
What is not promised
- Power-loss durability is unproven. A flush hands bytes to the operating system; it does not force them to stable storage. What survives a power cut depends on the filesystem, mount options and the drive. See the repository's crash durability note.
- Only the supported API is covered by semver. While the version is
0.x, a breaking change to a supported item is a minor-version bump. Everything behind theunstable-internalsfeature (fault injection, diagnostics, implementation modules) carries no promise at all; do not enable it in application code. The supported surface is listed in the Rust API contract. - Plain
insert,updateanddeleteare unconditional:insertreplaces,updateof a missing key creates it,deleteof a missing key succeeds. Useinsert_if_absentorcompare_and_set_jsonwhen you need a guard.
Targets
Built and tested on native targets. wasm32-wasip1 compiles. wasm32-unknown-unknown compiles only if
your crate enables getrandom's js feature.
Binaries
The package also builds feltdb-authority, feltdb-authority-client and feltdb_node, the process
authority and its client. cargo install feltdb installs them. Most applications want only the library.
Minimum Rust version
1.96, the oldest toolchain the project's CI builds and tests with.
License
MIT. See LICENSE.