Expand description
Git-model versioned storage: branches, commits, merge, and history.
Git-model versioned storage built on the persistent B+ tree.
§Concepts
| Git | vsdb |
|---|---|
| tree object | NodeId (root of a B+ tree) |
| commit | Commit |
| ref/branch | BranchId → mutable pointer |
| working dir | uncommitted writes on a branch |
git gc | VerMap::gc |
A version is a complete, self-contained snapshot (a B+ tree root). Branches are lightweight pointers. Structural sharing keeps storage costs proportional to the number of changes, not the dataset size.
§Workflow
new() ──► insert / remove ──► commit()
▲ │
│ ▼
discard() create_branch()
▲ │
│ ▼
rollback_to() insert / remove / commit
│
▼
merge() ──► delete_branch()
(ref-count GC)
│
gc() (B+ tree nodes)§Merkle proofs
VerMapWithProof wraps a VerMap<K, V>
with an MptCalc (or
SmtCalc) to provide a 32-byte Merkle root
commitment over the versioned state. See the trie
module for details.
Modules§
- map
VerMap— a typed, versioned key-value map with branch / commit / merge support, modelled after Git semantics.
Structs§
- Branch
Id - Identifies a branch.
- Commit
- An immutable snapshot in the version history.
- Commit
Id - Identifies a commit in the history DAG.
- Snapshot
- A read-only view of one immutable map state: a historical commit
(
VerMap::at) or a branch’s working state as of when the view was taken (VerMap::snapshot).
Enums§
- Diff
Entry - A single difference between two map states, decoded.