Compose your own setup
When no recipe matches your use case, compose your own: every noy-db build is the same four decisions, and this page lists every option each decision offers, with exactly what it adds to your createNoydb({...}). It is generated from the same data as the interactive Orientation map — use that for a guided version that writes the code block for you; use this page to read, search, or diff the whole option space at once.
The floor — an always-on kernel of ~6,500 LOC — gives you encrypted typed records, queries, and the in-memory store with zero opt-ins. Everything below is added only when you choose it, and tree-shakes away when you don't.
The four decisions
D1 — Architecture & persistence
where data lives.
| Capability | What to add | Depth |
|---|---|---|
| In-memory (dev / test) | kernel built-in default | essential |
| Local — file / browser-IDB | family to-file / to-browser-idb | essential |
| Pod — data at rest (.noydb backup / transport) | pod layer | important |
| Snapshots — checkpoint / restore + retention | snapshots service | important |
| Multi-tab (same browser) | family by-tabs | important |
| Same-room P2P (same network) | sync + family by-peer | important |
| Multiple stores / routing | routing service | advanced |
| Blob attachments | blobs service | important |
| Cloud + attestation | to-aws-* + at-* sealing + attestation | advanced |
| Fleet / multi-vault | cargo + pod → klum-db | advanced |
D2 — Encryption, identity & access
who unlocks, who reads what.
| Capability | What to add | Depth |
|---|---|---|
| Encrypt / decrypt at rest | kernel enclave — always-on | essential |
| 3-tier unlock — secret · authenticate · unlock | session + on-webauthn / on-oidc / on-pin | important |
| Mixed step-up (policy gates + 2FA factors) | tiers + on-totp / on-shamir | advanced |
| Public directory — readable label before unlock | public-envelope service | important |
| Recover credentials — paper / Shamir | on-recovery / on-shamir | important |
| Sensitive fields — verify-without-reveal, blind index | classified service | important |
| Multiple users | team service (withTeam()) | important |
| Roles · grant / revoke / rotate (DEK/KEK) | team service | important |
| Multiple owners (co-ownership / deed) | team + createDeedOwner (core) | advanced |
| Delegation (magic-link grant) | team / magic-link | advanced |
| Export | family as-* + portability | important |
| Audited access / export of sensitive data | classified + consent + history | advanced |
D3 — Data & query
shape and operations.
| Capability | What to add | Depth |
|---|---|---|
| Typed records + refs | kernel schema — free | essential |
| Field metadata / describe() | kernel /ui port | important |
| Joins · cross-join | joins (+ indexing) | important |
| Aggregate / groupBy | aggregate service | important |
| Index | indexing service | important |
| Search / full-text (BM25 + lexical) | search service | important |
| Versioning / time-machine | history service | important |
| Live / reactive | live service | important |
| i18n / multi-locale | i18n service | important |
| CRDT | crdt service | advanced |
| Derived / materialized / overlay views | derivations · materialized-views · overlay-views | advanced |
D4 — Schema evolution & operations
lifecycle — mostly planned.
| Capability | What to add | Depth |
|---|---|---|
| Schema update — field rename + backfill | @noy-db/hub/migrations | (planned) |
| Migration between hub versions | migrations + peer-range policy | (planned) |
| Coordinated cut-over (multi-consumer) | migration recipe + minVersion guard | (planned) |
The service catalog
Each service is one with*() factory passed to createNoydb under its option key. Its page states its prerequisites; its LOC is the approximate bundle cost you accept by opting in.
| Service | Opt-in | Adds ~LOC | What it does |
|---|---|---|---|
indexing | withIndexing() → indexingStrategy (@noy-db/hub/indexing) | ~886 | Eager + lazy persisted indexes (equality + orderBy). |
joins | withJoins() → joinsStrategy (@noy-db/hub/joins) | ~470 | Multi-FK joins — indexed nested-loop / hash strategy. (always-core today; subpath reserved) |
reduce | withReduce() → reduceStrategy (@noy-db/hub/reduce) | ~886 | |
search | withSearch() → searchStrategy (@noy-db/hub/search) | ~400 | Full-text — BM25 scan (L0) + client lexical index (L1). (preview) |
live | withLive() → liveStrategy (@noy-db/hub/live) | ~210 | (always-core today; subpath reserved) |
history | withHistory() → historyStrategy (@noy-db/hub/history) | ~1880 | Versioning, diff, revert, time-machine, audit ledger. |
crdt | withCrdt() → crdtStrategy (@noy-db/hub/crdt) | ~221 | LWW-Map / RGA / Yjs interop. |
derivations | withDerivations() → derivationsStrategy (@noy-db/hub/derivations) | ~550 | Deterministic derived data — source row → typed outputs. |
materialized-views | withMaterializedViews() → materializedViewsStrategy (@noy-db/hub/materialized-views) | ~1400 | Query-level materialized views with refresh modes. |
overlay-views | withOverlayViews() → overlayViewsStrategy (@noy-db/hub/overlay-views) | ~600 | Operator-editable overlay over a materialized view. |
blobs | withBlobs() → blobsStrategy (@noy-db/hub/blobs) | ~2376 | Binary attachments + compaction + MIME-magic. |
i18n | withI18n() → i18nStrategy (@noy-db/hub/i18n) | ~854 | Multi-locale records + dict-key resolution. |
classified | withClassified() → classifiedStrategy (@noy-db/hub/classified) | ~1150 | Sensitive fields — verify-without-reveal, blind index. |
periods | withPeriods() → periodsStrategy (@noy-db/hub/periods) | ~334 | Accounting periods + closed-period write guard. |
consent | withConsent() → consentStrategy (@noy-db/hub/consent) | ~194 | Consent audit log (GDPR / PIPL-friendly). |
guards | withGuards() → guardsStrategy (@noy-db/hub/guards) | ~700 | Record lock + field freeze + role-gated amendment. |
portability | withPortability() → portabilityStrategy (@noy-db/hub/portability) | ~300 | Client data portability + public-envelope label. |
attestation | withAttestation() → attestationStrategy (@noy-db/hub/attestation) | ~500 | Signed attestation / verification of records. |
team | withTeam() → teamStrategy (@noy-db/hub/team) | ~1000 | Multi-user grant / revoke / rotate + magic-link + delegation. |
session | withSession() → sessionStrategy (@noy-db/hub/session) | ~839 | Token sessions + dev-unlock + policy enforcement. |
sync | withSync() → syncStrategy (@noy-db/hub/sync) | ~856 | P2P replication engine + presence. |
tiers | withTiers() → tiersStrategy (@noy-db/hub/tiers) | — | Three-tier auth + policy gates (design). (design) |
shadow | withShadow() → shadowStrategy (@noy-db/hub/shadow) | ~129 | Read-only vault.frame() views. |
snapshots | withSnapshots() → snapshotsStrategy (@noy-db/hub/snapshots) | ~200 | Vault checkpoint / restore + retention. |
routing | routeStore() from @noy-db/hub/store — wraps a store, not a createNoydb option | ~1800 | Multi-store routing + middleware + sync-policy. |
The six families
Satellite packages named by their relationship to the trust boundary — each binds exactly one port subpath and nothing else (see Families & ports):
| Family | Port | Purpose | Members |
|---|---|---|---|
to-* | /to | Storage destinations — the only layer that touches ciphertext on the wire. | file browser-idb browser-local · aws-s3 aws-dynamo cloudflare-r2 cloudflare-d1 · postgres mysql sqlite turso supabase · webdav ssh smb nfs · icloud drive · probe meter |
on-* | /on | Unlock / auth methods — how a user proves identity to open the vault. | webauthn oidc · magic-link · recovery shamir · totp email-otp password · pin · threat |
at-* | /at | Sealing-key providers — the one non-zero-knowledge family: a host you control can decrypt the scoped slice it unseals. | env macos-keychain · aws gcp azure |
in-* | /in | Framework integrations — reactive glue between a vault and your UI layer. | vue react solid svelte nuxt nextjs · pinia zustand · tanstack-query tanstack-table rest · yjs · ai |
by-* | /by | Session-share transports — move an unlocked session between contexts. | peer · tabs |
as-* | /as | Import / export data slices — portable artefacts in and out of a vault. | csv xlsx · json ndjson xml · sql · blob zip · noydb |
Worked compositions
The recipes are this page's worked examples, smallest to most opted-in: personal notebook (core only) → React invoice app (a framework binding + a store) → unlock ceremonies (on-* + session) → collaborative app (crdt + sync + team) → accounting app (six services composed). Each shows the resulting createNoydb({...}) block in its Setup section.
See also
- Orientation map — the interactive form of this page: tick capabilities, watch the code write itself.
- Services — every catalog entry's full page, prerequisites included.
- Recipes — start from the closest worked composition and add what's missing.