NHyDB
The full model
- Realms and layouts
- MATH_MAP: formulas decide where data lives
- Secondary and full-text indexes, SQL
- NumPy batch API
pip install nhydb
Database engine · Rust · Python
NHyDB does not store data in tables with keys but in an ordered address space. Every cell has coordinates and a natural number N that follows from them – exactly and in both directions.
pip install nhydbNHyDB portrait as PDF ↓PDF, 7 pages, 149 KB
Python 3.12–3.15 · Linux, macOS, Windows · License: source-available, non-production
import nhydb
with nhydb.create("notes.nhydb") as db:
db.create_realm(1, "notes")
db.create_shape(1, 1, "note",
[{"v": 1, "name": "text", "type": "utf8"}])
db.create_classic_layout(1, 1, "notes", shape_id=1)
db.put_record(1, 1, {"text": "buy milk"})
with nhydb.open("notes.nhydb") as db:
print(db.get_record(1, 1)["text"]) # buy milkNhyFlow is a workspace for writing, research and development. Every text, every note and every version lives at a fixed NHyDB address – locally, on your own servers and with synchronisation.
Seven pages on the idea, the features and the measurements of NHyDB 0.28.2 – to read, print and pass on. In English and German.
Python 3.12–3.15 and a round of fixes: stricter checks when writing and deleting single cells, iterators after rollback().
New file format with a block directory: a file with one million single-cell blocks opens in about 5 ms instead of 0.3 s. Secondary indexes as persistent key trees: first lookup 0.2 ms instead of 200 ms. Python 3.12–3.15.
Both engines for the first time as ready-made packages for Linux, macOS and Windows: pip install nhydb or pip install dnhydb.
In use
NhyFlow is a workspace for writing, research and development – alone, in a team and with AI. Under the surface NhyFlow is an NHyDB: the Rust engine is built in directly, and every text, every note and every version lives at a fixed address.
Example: anchor 3, version 2 lives at v = 300,000,001 – the text on NL, its note on NR of the same address.
| In NhyFlow | In NHyDB |
|---|---|
| Realm (project area) | realm R |
| U-line (a project, a book, a series of measurements) | u |
| Anchor k, version n | v = k · 10⁸ + (n − 1) |
| Text and the note next to it | lane NL and NR |
The address
The mathematics decides which cell is meant – what it means is up to the application. An example: a customer management application agrees that names are in the first row, streets in the second, postal codes in the third, cities in the fourth and dunning levels in the seventh. The same customer is at the same position in every row.
Anyone who knows a customer's position immediately knows the addresses of all their details. No link per field has to be stored. Row and position are the coordinates u and v: “row 2, position 4711” is the cell (R1, u2, v4711, NL) – and every cell has a fixed number that never needs to be stored.
The rule is the same for ten customers and for ten million. Only the amount of data grows, not the rule.
Why should a database still need artificial identifiers when mathematics already gives every cell a unique address?
The principle
In this way, a few general rules give rise to very large and very different information structures. The addresses are not the result of ongoing assignment; they are determined mathematically. The organisation of the data remains open.
NHyDB combines a firmly ordered mathematical address space with the freedom to build your own information worlds on it.
Two engines
The full model
pip install nhydb
The compact record store
pip install dnhydb
The storage core is Rust; Python accesses it through a thin binding – single values or whole NumPy blocks.
Data is only ever appended. A crash cannot damage a committed state.
Every block is verified. Damaged data is detected, not passed on silently.
A database is one file. No server, no service, no configuration needed.
KQ10M benchmark
The public KQ10M benchmark writes ten million records with eleven numeric fields each, builds three indexes and then verifies every result. It is freely available and can be repeated on your own hardware.
MacBook Pro, Apple M1 Max, macOS · NHyDB 0.28.2, mean of three runs
All six machines and test conditions → · Run the benchmark yourself
Writing, indexing and reading ten million records – measured on six machines, with a kit to measure your own.
The mathematics behind the address space: the Dynadron and why every number appears exactly once.
Task-oriented examples for the complete Python API, all tested.
The idea, the features and the measurements on seven pages – to print and pass on (PDF, 7 pages, 149 KB).
NHyDB and dNHyDB are published under the NHyDB / dNHyDB Experimental Software License 1.0: the source code is available, free use is limited to non-production purposes. License text