#sql #sqlite #low-level #high-performance

boringdb

Robust, reasonably high-performance key-value database built on SQLite

20 releases

0.4.1 May 12, 2022
0.3.15 May 9, 2022
0.3.14 Jan 18, 2022
0.3.13 Dec 8, 2021
0.3.10 Jul 8, 2021

#853 in Database interfaces

Download history 39/week @ 2023-05-31 21/week @ 2023-06-07 15/week @ 2023-06-14 55/week @ 2023-06-21 10/week @ 2023-06-28 10/week @ 2023-07-05 41/week @ 2023-07-12 17/week @ 2023-07-19 14/week @ 2023-07-26 5/week @ 2023-08-02 11/week @ 2023-08-09 28/week @ 2023-08-16 25/week @ 2023-08-23 29/week @ 2023-08-30 35/week @ 2023-09-06 6/week @ 2023-09-13

95 downloads per month
Used in 2 crates

ISC license

16KB
269 lines

BoringDB

A SQLite-based, single-process, key-value database.

You want boringdb if:

  • You want high performance somewhat approaching that of databases like sled and RocksDB
  • You don't need SQL, multiprocess support, or the other cool features of SQLite
  • You want SQLite's proven reliability

Method Of Operation

BoringDB stores key/value pairs into byte vectors (Vec<u8>).

Examples

We have various usage examples here.

To run any of the examples, execute:

cargo run --example example_name_goes_here

Cache architecture

We have a writeback cache supporting the following operations:

  • Insert with batch number
  • Read key with fallback closure
  • Remove dirty keys as an iterator-like object that returns batches.

lib.rs:

BoringDB

A SQLite-based, single-process, key-value database.

You want boringdb if:

  • You want high performance somewhat approaching that of databases like sled and RocksDB
  • You don't need SQL, multiprocess support, or the other cool features of SQLite
  • You want SQLite's proven reliability

A note on durability

By default, boringdb has eventual durability: database state is guaranteed to be consistent even in the face of arbitrary crashes, and transactions are guaranteed to have "serializable" semantics. However, after a crash the database may be slightly out of date, usually by a fraction of a second.

To avoid this behavior, use the Dict::flush method to manually force synchronization with disk. Note that this comes with a fairly severe performance cost.

Method Of Operation

BoringDB stores key/value pairs into byte vectors (Vec<u8>).

Examples

Examples can be found in the examples directory

Dependencies

~22MB
~417K SLoC