Crate raindb

Source
Expand description

RainDB is a key-value store that is based on LevelDB. This project aims to be a learning tool for those looking to take a deep dive on databases. It strives to uphold a high standard of code clarity and to have extensive documentation on design and intentions of code. With regard to this, we have configured the project such that rustdoc generates output even for private methods.

Please see the RainDB repo for more in-depth treatment on the design and operation of the database.

Re-exportsยง

pub use db::DB;
pub use errors::RainDBError;
pub use errors::RainDBResult;
pub use filter_policy::BloomFilterPolicy;
pub use filter_policy::FilterPolicy;
pub use options::DbOptions;
pub use options::ReadOptions;
pub use options::WriteOptions;
pub use snapshots::Snapshot;

Modulesยง

batch ๐Ÿ”’
This module contains representations and utility functions for batch functions.
compaction ๐Ÿ”’
This module contains abstractions used in compaction operations. Core to this is the CompactionWorker worker thread.
config ๐Ÿ”’
This module contains global configuration constants for RainDB.
db
The database module contains the primary API for interacting with the key-value store.
errors
This module contains error types specific to RainDB as well as wrappers and From implementations for common errors to enable error propagation.
file_names ๐Ÿ”’
This module contains utilities for managing file names used by the database.
filter_policy
This module provides a common interface for filter policies that can be provided at database startup. A filter policy is an object used to create a small filter from a set of keys. These filters are stored and consulted during reads to determine whether or not to read information from disk. This can have significant speed savings from removing unnecessary disk seeks on database get operations.
fs
This module contains abstractions for file systems.
iterator ๐Ÿ”’
key ๐Ÿ”’
This module contains implementations of keys used to index values in the RainDB. There are two main keys that are used:
logs ๐Ÿ”’
The log file format is used by both write-ahead logs and manifest files (a.k.a. descriptor logs).
memtable ๐Ÿ”’
options
This module holds the various option structures that can be passed to RainDB operations
snapshots
Snapshots are used to scope a request to the state of a database at a point in time.
table_cache ๐Ÿ”’
This module provides a thread-safe table cache.
tables ๐Ÿ”’
utils ๐Ÿ”’
versioning ๐Ÿ”’
This module contains the database versioning abstractions.
writers ๐Ÿ”’
This module provides abstractions that represent threads performing write operations, specifically the Writer struct.

Structsยง

Batch
A set of operations to perform atomically.
BatchElement
Element of a batch operation.

Enumsยง

Operation
The operation that is being applied to an entry in the database.

Traitsยง

Cache
A cache that stores mappings from keys to values.
RainDbIterator
A RainDB specific iterator implementation that has more cursor-like behavior.