Crates.io | readb |
lib.rs | readb |
version | 0.4.1 |
source | src |
created_at | 2023-08-14 23:39:34.745771 |
updated_at | 2023-09-05 18:48:02.815935 |
description | A simple, efficient, and modular embedded read-first key-value database in Rust. |
homepage | https://github.com/Basis-Health/readb |
repository | https://github.com/Basis-Health/readb |
max_upload_size | |
id | 944622 |
size | 276,592 |
use readb::Database;
.unwrap()
. An .unwrap()
method remains for backward compatibility.
create_path
attribute in DatabaseSettings
. This could be a breaking change if you arenβt using the Default
.π "Don't reinvent the wheel." Despite this wisdom, here we are with readb: a fresh, streamlined embedded key-value database crafted in pure Rust.
Balancing simplicity akin to sled, readb boasts outstanding read performance. Primarily focused on reads, it also caters to writes and deletes. It remains lightweight with minimal dependencies and under 200KB size.
readb thrives on being read-centric. Assuming data remains largely static, we strike a balance between memory efficiency and speed by leveraging disk and memory effectively.
Data management includes:
readb's linear approach stands out from the norm, ensuring swift operations.
If you predominantly deal with read requests and yearn for a speedy, efficient local solution, readb awaits. While it excels in write speeds, it does so with minor compromises on compression.
Write Benchmark:
Operations | readb max time |
sled max time |
---|---|---|
1,000 | 147.02 Β΅s | 332.65 Β΅s |
1,000,000 | 238.48 ms | 485.63 ms |
Read Benchmark:
Benchmark type | time readb | time sled | time redb |
---|---|---|---|
Retrieve 1000 items | 50.30 | 79.25 | 97.95 |
Retrieve 1000 items (10 percent) | 49.05 | 17.84 | 22.39 |
Retrieve 1000 items (20 percent with repetitions) | 49.16 | 33.92 | 43.17 |
Retrieve 10000 items | 67.56 | 1,256.75 | 1,225.68 |
Retrieve 10000 items (10 percent) | 55.29 | 311.57 | 357.98 |
Retrieve 10000 items (20 percent with repetitions) | 61.13 | 541.79 | 692.16 |
Retrieve 100000 items | 209.59 | 36,977 | 52,558 |
Retrieve 100000 items (10 percent) | 86.25 | 3,465.1 | 5,090.9 |
Retrieve 100000 items (20 percent with repetitions) | 124.29 | 6,831.8 | 10,151 |
Visuals:
The Database
struct manages indexing, caching, and data loading and requires two generics:
C
: Cache mechanism (implement the Cache
trait).L
: Data loader (implement the Loader
trait).From fetching keys to maintaining data consistency, we've got you covered.
From data writes to efficient garbage management, elevate your database game.
With a stabilized API, our focus shifts to refining caching and enhancing documentation. As we inch towards our 1.0 release, backward compatibility remains paramount.
Licensed under the Apache License, Version 2.0. Dive into the NOTICE file for more details.