In detail
Version and status. dNHyDB 0.3.0 of 14 November 2026, alpha status: the interface may still change between minor versions.
Platforms. CPython 3.12 to 3.15, prebuilt packages for Linux (x86_64, aarch64), macOS (x86_64, arm64) and Windows (x64): pip install dnhydb. The Rust core (crates/dnhydb-core) has no Python dependency and can also be used directly.
Addresses. The cell is (R1, u, v, s) with u, v from 1 to 2⁶⁴ − 1 and s = NL (0) or NR (1). N = G² − u on NL, N = G² + v on NR, G = u + v – the same formula as in NHyDB, realm 1. N needs up to 130 bits and is returned as a Python integer: dnhydb.n_of, dnhydb.address_of.
Data types. 15 storage types: u8 to u64, i8 to i64, f32, f64, bool, varuint, varint, utf8, bytes. Integers up to 128 bits; integers in free cells are always stored as varint. None in a BASE field raises ValueError – optional values belong in extensions or free cells.
BASE. define_base defines the fields; they are mandatory in every record and can only be extended. Extensions: define_extension, free cells: put_cell.
Files. The database is a single file (.dnhydb). Next to it are the writer lock (.lock) and a catalog (.dnhydb-index), which speeds up opening and is recreated when needed. For a backup the .dnhydb file is enough.
Writing. put_record, put_records, put_cells, put_records_numpy, put_cells_numpy; commit policy via set_commit_policy. Transactions with begin() or with db.transaction(): – not nestable, within one process. with dnhydb.create(...) or with dnhydb.open(...) commits on success and discards on an exception.
Durability. fsync, full or none. On macOS, full uses F_FULLFSYNC and silently falls back to fsync if the file system refuses it; on Linux, full equals fsync; on Windows both use FlushFileBuffers.
Readers. dnhydb.open_reader(path) opens a snapshot at the last commit; refresh() picks up the newest commit and returns True if there was one. With auto_refresh=True this happens automatically.
Crash safety. Append-only file with two superblocks protected by CRC. After a crash the last commit is valid.
VALUE index. create_index, build_indexes, find_u – for equality and ranges. It is the only index type and is not kept up to date automatically; an outdated index reports StaleIndexError.
Maintenance. stats, health, verify, checkpoint, compact (in place or as a copy, even with open readers), repair_file, inspect_tail.
Limits. Only realm R1 and the CLASSIC layout, no query language; one writer at a time. On Windows, replacing the file while readers are open (compaction) requires Windows 10 or later with NTFS. Complete list: Cookbook, section 21.
About the example
On the exception, db.transaction() discards everything written in the block – the stock stays at 500. The reader was opened before the second commit: get_record(2) first returns None, after refresh() the new record. More: Cookbook, section 12 and section 13.
Read more
# In detail **Version and status.** dNHyDB 0.3.0 of 14 November 2026, alpha status: the interface may still change between minor versions. **Platforms.** CPython 3.12 to 3.15, prebuilt packages for Linux (x86_64, aarch64), macOS (x86_64, arm64) and Windows (x64): `pip install dnhydb`. The Rust core (`crates/dnhydb-core`) has no Python dependency and can also be used directly. **Addresses.** The cell is (R1, u, v, s) with u, v from 1 to 2⁶⁴ − 1 and s = NL (0) or NR (1). N = G² − u on NL, N = G² + v on NR, G = u + v – the same formula as in NHyDB, realm 1. N needs up to 130 bits and is returned as a Python integer: `dnhydb.n_of`, `dnhydb.address_of`. **Data types.** 15 storage types: `u8` to `u64`, `i8` to `i64`, `f32`, `f64`, `bool`, `varuint`, `varint`, `utf8`, `bytes`. Integers up to 128 bits; integers in free cells are always stored as `varint`. `None` in a BASE field raises `ValueError` – optional values belong in extensions or free cells. **BASE.** `define_base` defines the fields; they are mandatory in every record and can only be extended. Extensions: `define_extension`, free cells: `put_cell`. **Files.** The database is a single file (`.dnhydb`). Next to it are the writer lock (`.lock`) and a catalog (`.dnhydb-index`), which speeds up opening and is recreated when needed. For a backup the `.dnhydb` file is enough. **Writing.** `put_record`, `put_records`, `put_cells`, `put_records_numpy`, `put_cells_numpy`; commit policy via `set_commit_policy`. Transactions with `begin()` or `with db.transaction():` – not nestable, within one process. `with dnhydb.create(...)` or `with dnhydb.open(...)` commits on success and discards on an exception. **Durability.** `fsync`, `full` or `none`. On macOS, `full` uses `F_FULLFSYNC` and silently falls back to `fsync` if the file system refuses it; on Linux, `full` equals `fsync`; on Windows both use `FlushFileBuffers`. **Readers.** `dnhydb.open_reader(path)` opens a snapshot at the last commit; `refresh()` picks up the newest commit and returns `True` if there was one. With `auto_refresh=True` this happens automatically. **Crash safety.** Append-only file with two superblocks protected by CRC. After a crash the last commit is valid. **VALUE index.** `create_index`, `build_indexes`, `find_u` – for equality and ranges. It is the only index type and is not kept up to date automatically; an outdated index reports `StaleIndexError`. **Maintenance.** `stats`, `health`, `verify`, `checkpoint`, `compact` (in place or as a copy, even with open readers), `repair_file`, `inspect_tail`. **Limits.** Only realm R1 and the CLASSIC layout, no query language; one writer at a time. On Windows, replacing the file while readers are open (compaction) requires Windows 10 or later with NTFS. Complete list: [Cookbook, section 21](https://github.com/nhydb-run4/dNHyDB/blob/main/docs/cookbook/PYTHON_COOKBOOK.md#21-limits-of-dnhydb). ## About the example On the exception, `db.transaction()` discards everything written in the block – the stock stays at 500. The reader was opened before the second commit: `get_record(2)` first returns `None`, after `refresh()` the new record. More: [Cookbook, section 12](https://github.com/nhydb-run4/dNHyDB/blob/main/docs/cookbook/PYTHON_COOKBOOK.md#12-transactions-rollback-commit-policy-and-durability) and [section 13](https://github.com/nhydb-run4/dNHyDB/blob/main/docs/cookbook/PYTHON_COOKBOOK.md#13-one-writer-many-readers). ## Read more - [README on GitHub](https://github.com/nhydb-run4/dNHyDB) · [Releases](https://github.com/nhydb-run4/dNHyDB/releases) · [PyPI](https://pypi.org/project/dnhydb/)- [Python Cookbook](https://github.com/nhydb-run4/dNHyDB/blob/main/docs/cookbook/PYTHON_COOKBOOK.md) – the complete interface with tested examples- [Technical documentation](https://github.com/nhydb-run4/dNHyDB/blob/main/docs/en/dNHyDB_Technical_Documentation.md)