Skip to content

Versioning

MountSQLI storage supports content-addressed versioning: each revision of an object is addressed by a hash of its content, so identical bytes are stored once.

flowchart LR
  A[put(key, bytes)] --> B[hash(bytes)]
  B --> C[store at content address]
  C --> D[record version -> key]

When you put the same bytes again, the content address is identical — the storage deduplicates, and a new version pointer is recorded.

await storage.put("report.pdf", buffer);
// later
await storage.put("report.pdf", updatedBuffer); // new version, old retained
const current = await storage.get("report.pdf");
const older = await storage.get("report.pdf", { version: "v2" });
  • Deduplication — identical content stored once.
  • History — prior versions remain readable.
  • Integrity — the content hash is the address, so corruption is detectable.
  • Use versioning for user-uploaded, mutable files.
  • Prune old versions on a schedule if storage grows.
  • Combine with signed URLs for safe sharing of a specific version.
  • Assuming get returns the latest when you meant a pinned version.
  • Never pruning versions — storage grows unbounded.