{"id":20267868,"url":"https://github.com/mit-pdos/vmvcc","last_synced_at":"2025-10-10T19:33:56.167Z","repository":{"id":45746508,"uuid":"434048154","full_name":"mit-pdos/vmvcc","owner":"mit-pdos","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-08T18:31:51.000Z","size":262,"stargazers_count":21,"open_issues_count":0,"forks_count":3,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-05-08T19:38:22.039Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mit-pdos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-12-02T01:54:42.000Z","updated_at":"2025-05-08T18:31:54.000Z","dependencies_parsed_at":"2024-06-04T20:45:52.974Z","dependency_job_id":"d94c0418-a4b8-4b05-ac0b-e8d14263523e","html_url":"https://github.com/mit-pdos/vmvcc","commit_stats":null,"previous_names":["mit-pdos/go-mvcc"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/mit-pdos/vmvcc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mit-pdos%2Fvmvcc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mit-pdos%2Fvmvcc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mit-pdos%2Fvmvcc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mit-pdos%2Fvmvcc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mit-pdos","download_url":"https://codeload.github.com/mit-pdos/vmvcc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mit-pdos%2Fvmvcc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279005031,"owners_count":26083827,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T12:15:40.608Z","updated_at":"2025-10-10T19:33:56.130Z","avatar_url":"https://github.com/mit-pdos.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vMVCC: Verified transaction library using multi-version concurrency control\n\nvMVCC is a transaction library aimed at reducing the effort of writing\n**concurrent** application code.  It is implemented in Go and verified with\n[Perennial](https://github.com/mit-pdos/perennial),\n[Iris](https://iris-project.org/), and Coq.  This repository contains its\nimplementation.  You can find its formal specification and proof\n[here](https://github.com/mit-pdos/perennial/tree/master/src/program_proof/mvcc).\n\nFor a high-level overview of its system architecture and proof, please refer to\nour [OSDI'23 paper](https://pdos.csail.mit.edu/papers/vmvcc:osdi23.pdf).\n\n## Limitations\n\n1. Interface limited to `uint64` keys and `string` values\n2. No durability\n3. No range query\n\n## Usage\n\nSee [`examples/hello.go`](examples/hello.go) for a minimal example of using\nvMVCC.\n\n### Import vMVCC\n\n```go\nimport \"github.com/mit-pdos/vmvcc/vmvcc\"\n```\n\n### Creating a database and activating garbage collection\n\n```go\nfunc MkDB() *DB\nfunc (db *DB) ActivateGC()\n```\n\n### Reading and writing the database\n\nDefine your **transaction body** with the following methods:\n\n```go\nfunc (txn *Txn) Read(key uint64) (string, bool)\nfunc (txn *Txn) Write(key uint64, val string)\nfunc (txn *Txn) Delete(key uint64) bool\n```\n\n### Executing transactions\n\nPick one of the approaches below to execute transactions.\n\n#### Approach 1: `db.Run`\n\nPass your transaction body to `db.Run` to run the transaction atomically:\n\n```go\nfunc (db *DB) Run(body func(txn *Txn) bool) bool\n```\n\nIt is safe to call `db.Run` concurrently on multiple threads.\n\n#### Approach 2: `txn.Run`\n\nTo reduce memory allocation for transaction objects, and to have more control\nover the assignment of transaction sites, another way to run transactions is\nwith the following approach: (1) create a transaction object `txn` with\n`db.NewTxn`, and (2) call `txn.Run` to run the transaction atomically.\n\n```go\nfunc (db *DB) NewTxn() *Txn\nfunc (txn *Txn) Run(body func(txn *Txn) bool) bool\n```\n\nYou can reuse `txn` as many times as you want, and it is safe to call `Run`\nconcurrently with **different** transaction objects.  However, it is **NOT**\nsafe to call `Run` with the **same** transaction object concurrently.\n\n#### Transactions with arguments\n\nBoth `Run` methods (on `Txn` and on `DB`) expect a function that takes a single\ntransaction object; use [function closures](https://go.dev/tour/moretypes/25) to\ndefine your transaction with additional arguments. See\n[`examples/xfer.go`](examples/xfer.go) for an example.\n\n## Reproducing the results in the OSDI'23 paper\n\nAll the scripts for reproducing the results in the paper can be found in\n[`osdi23/scripts`](osdi23/scripts).\n\nRun all the experiments with `./osdi23/scripts/all.sh`.  The results will be\ngenerated in the CSV format under the `./exp` directory.\n\n## Developing\n\nTo build the code that should be working, run\n\n```\n./scripts/test.sh\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmit-pdos%2Fvmvcc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmit-pdos%2Fvmvcc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmit-pdos%2Fvmvcc/lists"}