Crate valog

Source
Expand description

VaLog

A lock-free, generic, lightweight value log for WiscKey architecture databases.

github LoC Build codecov

docs.rs crates.io crates.io license

English | 简体中文

§Introduction

This crate is designed for databases based on the WiscKey architecture, which separates the storage of keys from values. Consequently, this crate focuses exclusively on managing values. Users are responsible for storing the ValuePointers returned by the write* APIs.

§Features

  • Lock-Free and Concurrently Safe: Engineered for high-performance concurrent access without the use of locks.
  • Generic Data Structure Support: Provides flexibility to accommodate a variety of data types.
  • In-Place Writing: Guarantees no additional memory allocation during write operations.
  • Zero-Copy Reads: Enables efficient reading without unnecessary data duplication.
  • Three Mode Support:
    • Vec: Usable in environments without the standard library (no_std).
    • Anonymous Memory Mapping: Efficiently manages memory through an anonymous memory map.
    • File-Backed Memory Map: Functions similarly to an in-memory arena but stores data persistently on disk.

This crate offers a robust solution for managing value storage in WiscKey-based databases, prioritizing both performance and efficiency.

§Installation

  • Default

    [dependencies]
    valog = "0.2"
  • no_std full in-memory mode

    [dependencies]
    valog = { version = "0.2", default-features = false, features = ["alloc"] }

§Example

Please see examples.

§License

valog is under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE-APACHE, LICENSE-MIT for details.

Copyright (c) 2024 Al Liu.

Re-exports§

pub use options::Builder;

Modules§

checksum
Traits and structs for checksuming.
error
Error types.
options
Options for configuring the value log.
sync
Value log implementation for concurrent environment.
unsync
Value log implementation for single-threaded environment.
utils
Utils for developing database

Structs§

GenericValueLog
Generic value log.
ImmutableGenericValueLog
Immutable generic value log.
ImmutableValueLog
The immutable value log implementation.
SliceRef
A wrapper type for &'a [u8].
Str
A wrapper type for &'a str.
VacantBuffer
A vacant buffer in the WAL.
ValueBuilder
The value builder for building a value in place when inserting into the value log.
ValueLog
The value log implementation.
ValuePointer
The pointer to the value in the log.

Traits§

Frozen
A marker trait which means that the log is frozen and cannot be modified.
GenericLogReader
The immutable generic value log reader abstraction.
GenericLogWriter
Generic log writer abstraction.
Log
The abstraction for the common methods of log.
LogExt
Extension methods for Log.
LogReader
The value log reader abstraction.
LogReaderExt
The extension trait for the LogReader trait.
LogWriter
The mutable value log abstraction.
LogWriterExt
The extension trait for the LogWriter trait.
Mutable
A marker trait which means that the log is mutable and can be modified.
MutableLog
The abstraction for the common mutable methods of log.
Type
The type trait for limiting the types that can be used as keys and values.
TypeRef
The reference type trait for the Type trait.