Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A simple, humane, typed key-value storage solution.

License

NotificationsYou must be signed in to change notification settings

mozilla/rkv

Repository files navigation

CI Build StatusDocumentationCrate

Therkv Rust crate is a simple, humane, typed key-value storage solution. It supports multiple backend engines with varying guarantees, such asLMDB for performance, or "SafeMode" for reliability.

⚠️ Warning⚠️

To use rkv in production/release environments at Mozilla, you may do so with the "SafeMode" backend, for example:

use rkv::{Manager,Rkv};use rkv::backend::{SafeMode,SafeModeEnvironment};letmut manager =Manager::<SafeModeEnvironment>::singleton().write().unwrap();let shared_rkv = manager.get_or_create(path,Rkv::new::<SafeMode>).unwrap();...

The "SafeMode" backend performs well, with two caveats: the entire database is stored in memory, and write transactions are synchronously written to disk (only on commit).

In the future, it will be advisable to switch to a different backend with better performance guarantees. We're working on either fixing some LMDB crashes, or offering more choices of backend engines (e.g. SQLite).

Use

Comprehensive information about using rkv is available in itsonline documentation, which can also be generated for local consumption:

cargo doc --open

Build

Build this project as you would build other Rust crates:

cargo build

Features

There are several features that you can opt-in and out of when using rkv:

By default,db-dup-sort anddb-int-key features offer high level database APIs which allow multiple values per key, and optimizations around integer-based keys respectively. Opt out of these default features when specifying the rkv dependency in your Cargo.toml file to disable them; doing so avoids a certain amount of overhead required to support them.

To aid fuzzing efforts,with-asan,with-fuzzer, andwith-fuzzer-no-link configure the build scripts responsible with compiling the underlying backing engines (e.g. LMDB) to build with these LLMV features enabled. Please refer to the official LLVM/Clang documentation on them for more informatiuon. These features are also disabled by default.

Test

Test this project as you would test other Rust crates:

cargotest

The project includes unit and doc tests embedded in thesrc/ files, integration tests in thetests/ subdirectory, and usage examples in theexamples/ subdirectory. To ensure your changes don't break examples, also run them via the run-all-examples.sh shell script:

./run-all-examples.sh

Note: the test fixtures in thetests/envs/ subdirectory aren't included in the package published to crates.io, so you must clone this repository in order to run the tests that depend on those fixtures or use therand anddump executables to recreate them.

Contribute

Of the various open source archetypes described inA Framework for Purposeful Open Source, the rkv project most closely resembles the Specialty Library, and we welcome contributions. Please report problems or ask questions using this repo's GitHubissue tracker and submitpull requests for code and documentation changes.

rkv relies on the latestrustfmt for code formatting, so please make sure your pull request passes the rustfmt before submitting it for review. See rustfmt'squick start for installation details.

We follow Mozilla'sCommunity Participation Guidelines while contributing to this project.

License

The rkv source code is licensed under the Apache License, Version 2.0, as described in theLICENSE file.

About

A simple, humane, typed key-value storage solution.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp