stable

`@noy-db/to-*` — Storage destinations

The storage-destination catalog: every to-* store from local file and IndexedDB to cloud, SQL, and remote filesystems — all handling ciphertext only.

Where your ciphertext lives. Pick one backend per vault — or several, via routeStore — and swap it later without touching your app code.

The to- prefix reads as "data goes to a backend." Every to-* package implements the same 6-method NoydbStore contract and only ever sees encrypted envelopes — never plaintext, and never a query (queries run inside the hub, after decryption). A few essential stores ship alongside noy-db; the extended stores — cloud object stores, SQL databases, remote filesystems, personal drives, and Cloudflare adapters — are published from the companion noy-db-to repo under the same @noy-db npm names, installed exactly like a core store. Which repo publishes each one, and the current counts, are in the generated store capabilities matrix — its Scope column, not this paragraph, is the authority.

Catalog

Local

PackageDescription
memoryFuller in-memory store. Tests, REPL, ephemeral caches. casAtomic: true, txAtomic: true.
fileLocal disk / USB stick. One JSON file per record, inspectable with any editor.
browser-idbThe recommended browser store for PWAs. IndexedDB quota is typically 50–80% of available disk; CAS is atomic.
browser-locallocalStorage for small vaults under the 5 MB cap, synchronous access. Optional key obfuscation.

Cloud object & KV

PackageDescription
aws-s3S3 object per record. Atomic CAS via conditional writes. loadAll() is O(N) requests.
aws-dynamoDynamoDB single-table (pk = vault, sk = {collection}#{id}), so loadAll() is a single Query.
cloudflare-r2Zero egress fees. S3-API-compatible: a thin factory around aws-s3 pointed at the R2 endpoint.
cloudflare-d1Edge SQLite inside Cloudflare Workers via the D1Database binding.

Cloud-sync drives

PackageDescription
driveGoogle Drive bundle store. Whole vault as one .noydb bundle, opaque ULID filename, in the hidden appDataFolder.
icloudiCloud Drive bundle store (Node on macOS). Detects .icloud eviction stubs; raises PodVersionConflictError on conflicts.

drive and icloud are bundle stores (NoydbPodStore): wrap them with wrapPodStore() from @noy-db/hub to get the standard six-method NoydbStore surface.

SQL

PackageDescription
postgresEncrypted-envelope KV in a single table with a jsonb column. Any duck-typed query(sql, params) client.
mysqlEncrypted-envelope KV with a JSON column, for MySQL 8+ / MariaDB.
sqliteSingle-file SQLite for 10K+ records. Duck-typed Database interface (better-sqlite3, node:sqlite, bun:sqlite).
tursoHosted libSQL with multi-region replication. Same table/DDL as sqlite — a factory swap.
supabaseThin factory over postgres for the Postgres connection you already have. Never talks to Supabase REST/Realtime.

Remote filesystems

PackageDescription
sshSFTP over SSH, keys only (no passwords). Any Linux/macOS server with sshd.
webdavNextcloud / ownCloud / Apache mod_dav, or any RFC 4918 server. Pure fetch()-based, zero dependencies.
smbSMB/CIFS (NTLM or Kerberos). Windows file servers, NAS devices, corporate shared drives.
nfsFile store for a pre-mounted NFS path, with pre-flight mount diagnostics (nolock, stale attribute caching).
restAny HTTP endpoint running an @noy-db/in-rest relay. The server holds ciphertext it cannot open.

Diagnostics & wrappers

PackageDescription
probeDiagnostic companion. Not a backend — benchmarks any store and reports its suitability for primary / sync-peer / backup / archive.
meterPass-through metrics wrapper. Wraps any store and records op latency, error rate, and CAS conflicts.

→ Source and changelogs: github.com/noy-db/to

Concepts

PageDescription
choosing a storeHow to pick a to-* store per platform, and the one real gap in the matrix.
store-locator descriptorsA credentialless, JSON-serializable second construction path alongside to<Kind>() — build from data, resolve back to a live store.

Compare

casAtomic is the load-bearing capability: whether put(expectedVersion) fails atomically on a version mismatch, or is only an advisory check.

StoreAtomic CASShapeBest for
memory✓recordtests, REPL, ephemeral caches
file✗recordUSB stick, local-first apps
browser-idb✓recordPWAs, browser apps
browser-local✗recordtiny vaults under 5 MB
aws-s3✓record + bundleS3 object storage, blobs
aws-dynamo✓recordsingle-table DynamoDB, low latency
cloudflare-r2✓recordzero-egress object storage
cloudflare-d1✓recordedge SQLite in Workers
driven/abundleGoogle Drive backup
icloudn/abundleiCloud Drive backup (macOS)
postgres✓recordPostgres-backed apps
mysql✓recordMySQL 8+ / MariaDB apps
sqlite✓record10K+ records, single file
turso✓recordhosted libSQL, multi-region
supabase✓recordexisting Supabase Postgres project
ssh✗recordSFTP servers, key-only auth
webdav✗recordNextcloud / ownCloud servers
smb✗recordWindows file servers, NAS
nfs✗recordpre-mounted NFS paths
rest✓recordan in-rest relay over HTTP
proben/adiagnosticbenchmarking a store before committing
metern/awrapperproduction latency / error metrics

Stores without atomic CAS are still safe as single-writer primaries or as backup / archive targets — pair them with a CAS-capable primary (e.g. postgres, aws-dynamo) when multiple writers are involved.