stable

Strategies

The with*() service-strategy directory: all 32 opt-in slots that unlock capabilities beyond the kernel, grouped by client / vault / collection level.

The kernel session documented on the Noydb reference works with zero add-ons. Every capability beyond it — history, sync, transactions, multi-user access, aggregation, and the rest — is an opt-in strategy you pass to createNoydb() through a with*() factory, and that tree-shakes out of your bundle when unused. Each strategy unlocks a set of methods; a method that needs a strategy throws a *NotEnabledError (or a documented equivalent) until you configure it. The plain-option keys you pass alongside these are on Configuration.

This directory is the full map, grouped by where the methods each slot unlocks appear — on the db session (client-level), on a vault, or on a collection. The full set is thirty-two slots: twenty-seven single-value strategies and five array-valued ones (guards, deferred numbering, derivations, materialized views, overlays — each takes a list of handles, marked (array) below).

Client-level

Strategies whose methods land on the db session itself.

Strategy slotwith*() factoryWhat it unlocksService
Multi-user accesswithTeam()db.grant() / db.revoke() / db.rotate() — grant or revoke a keyring, rotate a vault's collection DEKs in placeteam
Sovereign custodywithCustody()owner-only db.grantCustodian() / db.revokeCustodian() plus the vault.custody.* facade (incl. liberate())custody
Multi-record atomic writeswithTransactions()db.transaction(fn) — all-or-nothing writes across vaults and collections (dry-run + amendment overloads)transactions
Snapshot lifecyclewithSnapshots({ store })db.snapshot() / db.listSnapshots() / db.restoreSnapshot() into a snapshot store (integrity-verified on restore)snapshots
Replication + presencewithSync()db.push() / db.pull() / db.sync() / db.syncStatus(), the sync-transaction overload, and collection.presence()sync
Session policywithSession()enforces the configured sessionPolicy — idle / absolute timeouts, lock-on-background, global token revocationsession

Notes. Without withTeam() the floor is single-user and all three methods throw TeamNotEnabledError; custody methods throw CustodyNotEnabledError; setting sessionPolicy without withSession() throws at createNoydb(). See also session-tiers and Permissions & keyring.

Vault-level

Strategies whose methods land on a vault handle.

Strategy slotwith*() factoryWhat it unlocksService
Cold storagewithArchive({ store })vault.archive() / vault.restore() / vault.listArchived() against a second storearchive
GDPR erasurewithForget({ subjects })vault.forget(subjectId) crypto-shred + vault.rebuildSubjectIndex() (forces perRecordKeys, needs the history ledger)forget
LocalizationwithI18n()i18nText / dictKey field resolution and validation, plus vault.dictionary(name)i18n
Accounting periodswithPeriods()vault.openPeriod() / vault.closePeriod() / vault.listPeriods() and the closed-period write guardperiods
Vault frameswithShadow()vault.frame()shadow
Consent auditwithConsent()a per-operation audit trail into _consent_audit, read via vault.consentAudit()consent
Document attestationwithAttestation()vault.issueAttestation() / getDocumentSigningPublicKey() / revokeAttestation() / unrevokeAttestation() / getRevokedDocIds() / publishRevocationList()attestation
Record-scoped sealingwithSealedRecord()grantor-side vault.sealRecordToHost() / revokeSealedRecord() / rotateRecordCek() (host-side opener stays ungated)sealed-record
Data sovereigntywithPortability()the vault.user.* export / withdrawal surface: exportMyAccessibleData(), unilateralWithdrawal(), requestWithdrawal(), listWithdrawalRequests(), approveWithdrawal(), rejectWithdrawal()portability
Credential brokerwithBroker(config)vault.broker() — .enroll() / .rotate() / .credentialSource()broker
Atomic sequenceswithSequence()vault.sequence(name) — .next() / .peek() / .seedTo(), a CAS-backed monotonic countersequence
Partition extractionwithCargo()source-side extractPartition(vault, …) that lifts a re-keyed slice out as a portable partitiontransferable partitions
Materialized views (array)withMaterializedView(...)each handle registers a persisted, incrementally-maintained view; refresh with vault.refreshView(), read via vault.collection()materialized-views
Gap-free serials (array)withDeferredNumbering(...)each declares a numbering series; vault.sequence(series).next({ for }) reserves a slot, vault.runNumberingPass(series) assigns gap-free serialsnumbering

Notes. Missing-strategy throws: vault.forget() → ForgetStrategyNotConfiguredError; vault.broker() → BrokerNotEnabledError; sealed-record → SealedRecordNotEnabledError; portability → PortabilityNotEnabledError; sequence → SequenceNotEnabledError; cargo → CargoNotEnabledError; attestation → AttestationNotEnabledError. The recipient-side partition adopt / decrypt functions stay ungated.

Collection-level

Strategies whose methods land on a collection (or its query builder).

Strategy slotwith*() factoryWhat it unlocksService
Versioning + audit ledgerwithHistory()collection.history() / getVersion() / revert() / diff() / clearHistory() / pruneRecordHistory(), per-record snapshots, and the hash-chained ledger (vault.ledger(), vault.at())history
Binary attachmentswithBlobs()collection.blob(id) storage for large binary fieldsblobs
Secondary indexeswithIndexing()eager == / in fast-paths on declared indexes, .lazyQuery(), and index rebuild / reconcileindexing
Grouping + rollupswithReduce().aggregate() and .groupBy() on a queryaggregate
Conflict-free mergeswithCrdt()the merge engine for CRDT collections (lww-map / rga / yjs)crdt
Hierarchical access tierswithTiers()collection.putAtTier() / getAtTier() / listAtTier() / elevate() / demote()tiers
Classified fieldswithClassified()collection.reveal() for digest-only classified fieldsclassified
Search + retrievalwithSearch()collection.search() / retrieve() / similarTo() / warmIndex() / flushIndex() and put-time embedding-vector computesearch
Bounded working setwithLazy()lazy mode's bounded-LRU working set for prefetch: false collectionslazy
Write guards (array)withGuard(...)each handle registers a collection.put() invariant, dispatched in registration orderguards
Projections (array)withDerivation(...)each projects a source collection's writes into an output on put(); backfill with vault.deriveAll()derivations
Overlays (array)withOverlayedView(...)each layers a computed overlay onto a base collection's reads (read through vault.collection())overlay-views

Notes. Without their strategy: CRDT collections throw on the first put / sync-merge; reveal() → ClassifiedNotEnabledError; tier methods → TiersNotEnabledError; search methods → SearchNotEnabledError; history snapshots and prune / clear become silent no-ops while the read APIs throw; queries fall back to linear scans and .lazyQuery() throws.

See also

  • Configuration — every non-strategy option key you pass to createNoydb().
  • Noydb — the strategy-free kernel surface these slots build on.