NHyDBrun4

Database engine · Rust · Python

Every value has a mathematical address.

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

notes.py
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 milk

News

  1. In use

    NhyFlow 1.0.0 – the first application built on NHyDB

    NhyFlow 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.

  2. News

    NHyDB portrait to download

    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.

  3. Release

    dNHyDB 0.3.0

    Python 3.12–3.15 and a round of fixes: stricter checks when writing and deleting single cells, iterators after rollback().

  4. Release

    NHyDB 0.28.2

    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.

  5. Release

    NHyDB 0.27.1 and dNHyDB 0.2.0 on PyPI

    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 – the first application built on NHyDB

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 NhyFlowIn NHyDB
Realm (project area)realm R
U-line (a project, a book, a series of measurements)u
Anchor k, version nv = k · 10⁸ + (n − 1)
Text and the note next to itlane NL and NR

The address

Every value has its fixed place

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.

Position 4710
Position 4711
Position 4712
Row 1 · Name
…
Miller
…
Row 2 · Street
…
8 High Street
…
Row 3 · Postal code
…
35390
…
Row 4 · City
…
Giessen
…
Row 7 · Dunning level
…
5
…
The same position connects all details of a customer (sample data).

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.

Addresses without management

  • The addresses exist before the database starts. Even an empty database already has a complete, uniquely ordered address space.
  • No assignment, no collisions, no free lists. There is no counter that hands out addresses and no list of free slots. When a value is deleted, its address remains.
  • No storage for empty addresses. The address space is not reserved. Space is needed only for the content actually stored and its management data.
  • Very large addresses. The address space is not limited to a fixed machine word size; addresses with up to one million binary digits were tested.

Why should a database still need artificial identifiers when mathematics already gives every cell a unique address?

How the calculation works →

The principle

Three levels, one principle

Mathematicsdetermines the unique position of a cell.
Databasestores its content and makes it reliably accessible again.
Applicationdetermines the meaning and the relationships of the information.

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

NHyDB and dNHyDB

What both have in common

Native engine in Rust

The storage core is Rust; Python accesses it through a thin binding – single values or whole NumPy blocks.

Append-only

Data is only ever appended. A crash cannot damage a committed state.

Checksums everywhere

Every block is verified. Damaged data is detected, not passed on silently.

One file

A database is one file. No server, no service, no configuration needed.

KQ10M benchmark

Performance you can verify

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.

0.543 s10 million records written
18.42 M/srecords per second
4.335 sthree indexes built

MacBook Pro, Apple M1 Max, macOS · NHyDB 0.28.2, mean of three runs

All six machines and test conditions →  ·  Run the benchmark yourself