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.
How it works
Section titled “How it works”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.
Put a new version
Section titled “Put a new version”await storage.put("report.pdf", buffer);// laterawait storage.put("report.pdf", updatedBuffer); // new version, old retainedRead a version
Section titled “Read a version”const current = await storage.get("report.pdf");const older = await storage.get("report.pdf", { version: "v2" });Benefits
Section titled “Benefits”- Deduplication — identical content stored once.
- History — prior versions remain readable.
- Integrity — the content hash is the address, so corruption is detectable.
Best practices
Section titled “Best practices”- 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.
Common mistakes
Section titled “Common mistakes”- Assuming
getreturns the latest when you meant a pinned version. - Never pruning versions — storage grows unbounded.
Related
Section titled “Related”- Signed URLs — share a version safely.
- Overview — the
ObjectAclmodel.
