xyzDB

The data model

You declare a space and an identity, write records, and the engine decides the layout. There is no schema language and no separate DDL.

Lobes & records

A lobe is a collection that holds heterogeneous records — many _type values live in the same space. Every record gets an auto LID, _type, created_at and updated_at.

LOBE "workspace"   # optional — created on first PUT

PUT {_type: "Company", code: "ACME", name: "Acme Corp"} IN "workspace"

Anchors — identity

An anchor is a uniqueness constraint and an O(1) lookup in one. Declare it, then FIND ... WHERE field = resolves through the dictionary instead of scanning.

ANCHOR "code" UNIQUE IN "workspace"
AUTOANCHOR APPLY "code" IN "workspace"  # index records loaded before the anchor

Gravity & co-location

A *-prefixed field sets gravity: its value is hashed and records that share it co-locate contiguously on disk (a 22-byte Z-order key). Reading the cluster is one sweep.

PUT {*rfc: "ACME-001", _type: "Credit", monto: 50000} IN "creditos"

Ghosts — views that build themselves

A ghost is a materialized view kept fresh on every write — no REFRESH. Permanent ghosts you declare; ephemeral and promoted ghosts the engine builds from hot query traffic.

Vectors

Declare one searchable vector field per lobe. Storage is f32, lossless. NEAREST runs an exact, gravity-bounded scan — recall 1.0, no ANN index. You bring the query vector; the engine never embeds in the default mode.

VECTOR embedding IN "memories"

Five keyspaces

Underneath, turba keeps five independent LSM trees — records, identity, dictionary, ghosts and vectors — each with its own WAL, memtable and compaction.