#vec #disk #brk #data #on-chain

brk_vec

A push-only, truncable, compressable, saveable Vec

29 releases

Uses new Rust 2024

new 0.0.30 Apr 22, 2025
0.0.29 Apr 22, 2025
0.0.11 Mar 31, 2025
0.0.2 Feb 27, 2025

#1297 in Database interfaces

Download history 461/week @ 2025-02-27 228/week @ 2025-03-06 138/week @ 2025-03-13 135/week @ 2025-03-20 200/week @ 2025-03-27 1023/week @ 2025-04-03 536/week @ 2025-04-10 990/week @ 2025-04-17

2,753 downloads per month
Used in 6 crates (4 directly)

MIT license

55KB
1.5K SLoC

BRK Vec

GitHub Repo stars kibo.money License Version Documentation Size Dependency status Discord Nostr Bluesky X

A Vec (an array) that is stored on disk and thus which can be much larger than the available RAM.

Compared to a key/value store, the data stored is raw byte interpretation of the Vec's values without any overhead which is very efficient. Additionally it uses close to no RAM when caching isn't active and up to 100 MB when it is.

Compression is also available and built on top zstd to save even more space (from 0 to 75%). The tradeoff being slower reading speeds, especially random reading speeds. This is due to the data being stored in compressed pages of 16 KB, which means that if you to read even one value in that page you have to uncompress the whole page.

Dependencies

~10–17MB
~227K SLoC