Skip to content

In-memory

memory:// keeps every object in the process’s RAM. Nothing touches disk and everything disappears when the process exits.

import namidb
db = namidb.Client("memory://demo") # or "memory://?ns=demo"
db.cypher("CREATE (:Person {name: 'Alice'})")
Terminal window
namidb-server --store memory://demo --auth-token "$NAMIDB_AUTH_TOKEN"
namidb run "RETURN 1 AS x" # the CLI uses memory:// when --store is omitted

Behaviour

  • Each URI parse creates a new store. Two Client("memory://demo") objects in the same process do not share data; each starts empty. Share a single Client (it is thread-safe) when several parts of a program need the same in-memory graph.
  • The full engine runs on top: WAL, manifest commits, flush, compaction, indexes and constraints all behave as on a durable backend, which makes memory:// a faithful test fixture.
  • Only ns / namespace is accepted as a query parameter; anything else is an error, so a typo cannot silently open a different namespace.
  • Memory use grows with the data and is not bounded by the cache settings. Keep it to small graphs.

When to use it

Use memory:// forUse something else for
Unit and integration testsAnything you want to keep
Notebook experiments and demosGraphs larger than comfortable RAM
One-shot CLI checks (namidb run, namidb explain)Sharing a graph between processes

For a durable graph on one machine, switch to file://; nothing else in your code changes.