19 releases (breaking)

0.16.1 Mar 16, 2024
0.16.0 Nov 6, 2021
0.15.0 Jul 5, 2020
0.14.0 May 27, 2019

#6 in #in-process

Download history 2/week @ 2024-02-19 4/week @ 2024-02-26 117/week @ 2024-03-11 25/week @ 2024-03-18

146 downloads per month

Apache-2.0

16KB
354 lines

ipjdb (in-process JSON database)

This tool is no longer under active development. If you are interested in taking over or repurposing the name on crates.io, feel free to contact me: nbishop@nbishop.net

crates.io Documentation

This is a very simple database for storing JSON data. Each database consists of a number of collections. Collections contain items, which are JSON files.

The database is read and modified through a library; there is no separate server process.

Storage

Opening a database for the first time creates a directory. Collections are created as subdirectories within that root directory. Items in each collection are files containing JSON data with a unique ID as the file name. Example:

my_db.ipjdb/
    my_first_collection/
        8f1c09b585c57a94
        2df515d82e2d8e59
        c11237553a8eeede
    my_second_collection/
        75d2bcbf589fb94b
        46b04bb7277a7e46

Concurrency

File locking is used to make concurrent access to the database safe. Locks are taken at the collection level. Write operations take an exclusive lock and read operations take a shared lock.

Safety

I make no promises as to the production-readiness of this library. It needs a lot more tests, if nothing else. Patches welcome :)

License

Apache-2.0

Dependencies

~1–2MB
~40K SLoC