Preview · Embedded Document Store
MonaDB is an embedded document store for Python. It behaves like a dict of dicts and commits like a database. No schema, no server, no query language to learn. A Rust core on redb, documents as BSON.
# a collection is a dict; a document is its value import monadb db = monadb.open("app.db") db["users"]["alice"] = {"age": 30} db["users"]["alice"] # {"age": 30}
Subscript, in, len, iteration,
update, pop. It is a
MutableMapping, so the methods you expect are simply
there.
Keys use an order-preserving encoding, so iteration is sorted and range and prefix scans come free from the b-tree.
Backed by redb and running in-process alongside your code. One file on disk. No server, no daemon, no config to babysit.
Every operation is its own commit, and update()
commits a whole mapping at once. Readers never block; writers
serialize.
There is nothing to learn beyond the mapping protocol. Filtering is a comprehension over an iteration or a range — ordinary Python, on ordinary dicts.
The Rust core is seven files and three dependencies, and it compiles
with unsafe forbidden outright.
MonaDB runs in the same process as your code and reads from a single file on disk. There is no network hop between your application and your data.
It is not quite a dict: iteration is key order, keys are
typed, values are documents. All six differences are written down and
asserted in the test suite.
Getting Started
Install MonaDB and open a Python shell. One import, one file, no servers.