• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..15-Mar-2021-

examples/H15-Mar-2021-290213

src/H15-Mar-2021-6,0424,282

tests/H15-Mar-2021-2,7462,018

.appveyor.ymlH A D15-Mar-2021986 3934

.cargo-checksum.jsonH A D15-Mar-20215.4 KiB11

.rustfmt.tomlH A D15-Mar-2021107 54

.travis.ymlH A D15-Mar-20211.4 KiB4942

CODE_OF_CONDUCT.mdH A D15-Mar-2021691 1611

Cargo.tomlH A D15-Mar-20211.3 KiB5045

LICENSEH A D15-Mar-202111.1 KiB203169

README.mdH A D15-Mar-20214.7 KiB8450

run-all-examples.shH A D15-Mar-2021264 1510

README.md

1# rkv
2
3[![Travis CI Build Status](https://travis-ci.org/mozilla/rkv.svg?branch=master)](https://travis-ci.org/mozilla/rkv)
4[![Appveyor Build Status](https://ci.appveyor.com/api/projects/status/lk936u5y5bi6qafb/branch/master?svg=true)](https://ci.appveyor.com/project/mykmelez/rkv/branch/master)
5[![Documentation](https://docs.rs/rkv/badge.svg)](https://docs.rs/rkv/)
6[![Crate](https://img.shields.io/crates/v/rkv.svg)](https://crates.io/crates/rkv)
7
8The [rkv Rust crate](https://crates.io/crates/rkv) is a simple, humane, typed key-value storage solution. It supports multiple backend engines with varying guarantees, such as [LMDB](http://www.lmdb.tech/doc/) for performance, or "SafeMode" for reliability.
9
10## ⚠️ Warning ⚠️
11
12The LMDB backend is currently unstable and crash-prone. We're attempting to fix these crashes in bugs [1538539](https://bugzilla.mozilla.org/show_bug.cgi?id=1538539), [1538541](https://bugzilla.mozilla.org/show_bug.cgi?id=1538541) and [1550174](https://bugzilla.mozilla.org/show_bug.cgi?id=1550174).
13
14To use rkv in production/release environments at Mozilla, you may do so with the "SafeMode" backend, for example:
15
16```rust
17use rkv::{Manager, Rkv};
18use rkv::backend::{SafeMode, SafeModeEnvironment};
19
20let mut manager = Manager::<SafeModeEnvironment>::singleton().write().unwrap();
21let shared_rkv = manager.get_or_create(path, Rkv::new::<SafeMode>).unwrap();
22
23...
24```
25
26The "SafeMode` backend performs well, with two caveats: the entire database is stored in memory, and write transactions are synchronously written to disk on commit.
27
28In the future, it will be advisable to switch to a different backend with better performance guarantees. We're working on either fixing the LMDB crashes, or offering more choices of backend engines (e.g. SQLite).
29
30## Use
31
32Comprehensive information about using rkv is available in its [online documentation](https://docs.rs/rkv/), which can also be generated for local consumption:
33
34```sh
35cargo doc --open
36```
37
38## Build
39
40Build this project as you would build other Rust crates:
41
42```sh
43cargo build
44```
45
46### Features
47
48There are several features that you can opt-in and out of when using rkv:
49
50By default, `db-dup-sort` and `db-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.
51
52If you specify the `backtrace` feature, backtraces will be enabled in "failure"
53errors. This feature is disabled by default.
54
55To aid fuzzing efforts, `with-asan`, `with-fuzzer`, and `with-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.
56
57## Test
58
59Test this project as you would test other Rust crates:
60
61```sh
62cargo test
63```
64
65The project includes unit and doc tests embedded in the `src/` files, integration tests in the `tests/` subdirectory, and usage examples in the `examples/` subdirectory. To ensure your changes don't break examples, also run them via the run-all-examples.sh shell script:
66
67```sh
68./run-all-examples.sh
69```
70
71Note: the test fixtures in the `tests/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 the `rand` and `dump` executables to recreate them.
72
73## Contribute
74
75Of the various open source archetypes described in [A Framework for Purposeful Open Source](https://medium.com/mozilla-open-innovation/whats-your-open-source-strategy-here-are-10-answers-383221b3f9d3), the rkv project most closely resembles the Specialty Library, and we welcome contributions. Please report problems or ask questions using this repo's GitHub [issue tracker](https://github.com/mozilla/rkv/issues) and submit [pull requests](https://github.com/mozilla/rkv/pulls) for code and documentation changes.
76
77rkv relies on the latest [rustfmt](https://github.com/rust-lang-nursery/rustfmt) for code formatting, so please make sure your pull request passes the rustfmt before submitting it for review. See rustfmt's [quick start](https://github.com/rust-lang-nursery/rustfmt#quick-start) for installation details.
78
79We follow Mozilla's [Community Participation Guidelines](https://www.mozilla.org/en-US/about/governance/policies/participation/) while contributing to this project.
80
81## License
82
83The rkv source code is licensed under the Apache License, Version 2.0, as described in the [LICENSE](https://github.com/mozilla/rkv/blob/master/LICENSE) file.
84