nma.sh/ docs

Database (db), KV & CRDT

Every app gets three built-in durable storage primitives with zero external accounts, connection strings, or SDKs. Storage is scoped to your account and survives redeploys, rollbacks, and VM restarts.

Strong transactional database (db)

Sharded, strongly consistent key-value store with optimistic concurrency (db.cas) and ordered prefix scans (db.list):

js
// Write & read
await db.set("user:42", JSON.stringify({ name: "Ada" }));
const raw = await db.get("user:42");

// Versioned read + compare-and-swap (atomic update)
const { value, v } = await db.getv("counter");
const next = (Number(value || 0) + 1).toString();
const ok = await db.cas("counter", v, next);

// Ordered prefix scan (up to 1000 keys per page)
const page = await db.list({ prefix: "user:", limit: 100 });
// page => { keys: [...], next: "..." | null }

// Delete
await db.delete("user:42");

CLI & MCP inspection: Owner keys and Remote MCP can inspect and export your database anytime via db_list, db_get, db_delete, and db_export (or ssh nma.sh db export APP for unlimited NDJSON streaming).

Edge-cached store (kv)

Low-latency read-mostly key-value store cached at the edge—ideal for config, feature flags, and rendered fragments:

js
await kv.set("banner", "Launch week is live!");
const banner = await kv.get("banner");
await kv.delete("banner");

Conflict-free counters & registers (crdt)

High-throughput counters and last-write-wins registers that converge cleanly under concurrency without CAS retries:

js
await crdt.add("views:/", 1);
const views = await crdt.get("views:/");

Limits