Crate sanakirja

source ·
Expand description

Fast and reliable key-value store, under the Mozilla Public License (link as you like, share modifications).

Features

  • ACID semantics.

  • B trees with copy-on-write.

  • Support for referential transparency: databases can be cloned in time O(1).

  • Ultimately, we’d like to have no locks. Right now, there is a cross-process read write lock, that only commit takes exclusively (other parts of a mutable transaction need just a read access).

This version is only capable of inserting and retrieving keys in the database, allowing several bindings for the same key (get will retrieve the first one).

Modules

Values, which might be either inlined on the page, or stored as a reference if too large.

Structs

An iterator over a database.
A database is a skip list of (page offset, key, value).
Environment, required to start any transactions. Thread-safe, but opening the same database several times in the same process is not cross-platform.
Iterator on a page, plus a middle element immediately after off, with a fixed left and right child.
A mutable transaction.
An iterator over a database.
An immutable transaction.

Enums

Alignment of representables on page. The only implication is on how the write_value and read_value methods are going to be implemented.
Errors that can occur while transacting.

Traits

Transactions that can be committed.
Types that can be stored in a Sanakirja database, as keys or values. Some care must be taken when storing things.
Trait for operations common to mutable and immutable transactions.

Functions

Dumps a number of databases into a dot file.