In detail
Versions. The comparison covers NHyDB 0.28.2 and dNHyDB 0.3.0.
Interfaces compared
| Task |
NHyDB (nhydb) |
dNHyDB (dnhydb) |
| create, open |
create, open |
create, open |
| open read-only |
open(path, readonly=True) |
open_reader(path), then refresh() |
| structure |
create_realm, create_shape, create_classic_layout and others |
define_base, define_extension |
| write records |
put, put_dense_batch, put_record |
put_record, put_records |
| write a cell |
put_cell(realm, u, v, value) |
put_cell(u, v, value) |
| NumPy |
put_numpy_batch, read_numpy |
put_records_numpy, read_numpy |
| address → N |
dynadron_n(realm, u, v, lane) |
n_of(u, v, lane) |
| N → address |
n_to_dynadron_address(n) |
address_of(n) |
| index |
create_index, create_token_index, create_trigram_index, create_fulltext_index |
create_index (VALUE) |
| queries |
query, sql, QueryEngine |
find_u, iterators records, cells, scan |
| transactions |
commit, rollback, batch() |
commit, rollback, begin, transaction(), set_commit_policy |
How they behave differently
with block. NHyDB commits on leaving the block, even after an exception. dNHyDB commits on success and discards on an exception.
Readers. In NHyDB, a read-only object sees the state at opening. In dNHyDB, a reader picks up newer commits with refresh() or auto_refresh=True.
Indexes. NHyDB keeps indexes up to date by itself after the first build_indexes(). The VALUE index of dNHyDB is not maintained automatically; when outdated it reports StaleIndexError.
Durability. NHyDB: fsync or full. dNHyDB: additionally none.
Files. NHyDB: .nhydb, .layout.enc and .layout.key belong together; in addition .lock (writer lock) and limiter.txt (statistics of the memory limiter). dNHyDB: .dnhydb, plus .lock and the index catalog .dnhydb-index; for a backup the .dnhydb file is enough.
File formats. NHyDB reads only the 0.28.2 format, dNHyDB the NHYDB014 format. A file of the other engine is rejected with CorruptionError and left unchanged.
Query language. Only NHyDB has NHySQL – read-only (SELECT), on CLASSIC layouts.
Read more
NHyDB · dNHyDB · README sections “Sibling project”: NHyDB · dNHyDB
# In detail **Versions.** The comparison covers NHyDB 0.28.2 and dNHyDB 0.3.0. ## Interfaces compared | Task | NHyDB (`nhydb`) | dNHyDB (`dnhydb`) ||---|---|---|| create, open | `create`, `open` | `create`, `open` || open read-only | `open(path, readonly=True)` | `open_reader(path)`, then `refresh()` || structure | `create_realm`, `create_shape`, `create_classic_layout` and others | `define_base`, `define_extension` || write records | `put`, `put_dense_batch`, `put_record` | `put_record`, `put_records` || write a cell | `put_cell(realm, u, v, value)` | `put_cell(u, v, value)` || NumPy | `put_numpy_batch`, `read_numpy` | `put_records_numpy`, `read_numpy` || address → N | `dynadron_n(realm, u, v, lane)` | `n_of(u, v, lane)` || N → address | `n_to_dynadron_address(n)` | `address_of(n)` || index | `create_index`, `create_token_index`, `create_trigram_index`, `create_fulltext_index` | `create_index` (VALUE) || queries | `query`, `sql`, `QueryEngine` | `find_u`, iterators `records`, `cells`, `scan` || transactions | `commit`, `rollback`, `batch()` | `commit`, `rollback`, `begin`, `transaction()`, `set_commit_policy` | ## How they behave differently **`with` block.** NHyDB commits on leaving the block, even after an exception. dNHyDB commits on success and discards on an exception. **Readers.** In NHyDB, a read-only object sees the state at opening. In dNHyDB, a reader picks up newer commits with `refresh()` or `auto_refresh=True`. **Indexes.** NHyDB keeps indexes up to date by itself after the first `build_indexes()`. The VALUE index of dNHyDB is not maintained automatically; when outdated it reports `StaleIndexError`. **Durability.** NHyDB: `fsync` or `full`. dNHyDB: additionally `none`. **Files.** NHyDB: `.nhydb`, `.layout.enc` and `.layout.key` belong together; in addition `.lock` (writer lock) and `limiter.txt` (statistics of the memory limiter). dNHyDB: `.dnhydb`, plus `.lock` and the index catalog `.dnhydb-index`; for a backup the `.dnhydb` file is enough. **File formats.** NHyDB reads only the 0.28.2 format, dNHyDB the `NHYDB014` format. A file of the other engine is rejected with `CorruptionError` and left unchanged. **Query language.** Only NHyDB has NHySQL – read-only (`SELECT`), on CLASSIC layouts. ## Read more [NHyDB](/en/nhydb/) · [dNHyDB](/en/dnhydb/) · README sections “Sibling project”: [NHyDB](https://github.com/nhydb-run4/NHyDB#sibling-project-dnhydb) · [dNHyDB](https://github.com/nhydb-run4/dNHyDB#sibling-project-nhydb)