{"id":13440362,"url":"https://github.com/losfair/mvsqlite","last_synced_at":"2026-04-05T11:01:24.162Z","repository":{"id":50087250,"uuid":"517745858","full_name":"losfair/mvsqlite","owner":"losfair","description":"Distributed, MVCC SQLite that runs on FoundationDB.","archived":false,"fork":false,"pushed_at":"2026-03-31T20:53:03.000Z","size":593,"stargazers_count":1534,"open_issues_count":32,"forks_count":43,"subscribers_count":22,"default_branch":"main","last_synced_at":"2026-04-03T03:20:15.748Z","etag":null,"topics":["database","rust"],"latest_commit_sha":null,"homepage":"https://github.com/losfair/mvsqlite/wiki","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/losfair.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-07-25T16:45:08.000Z","updated_at":"2026-04-02T14:36:25.000Z","dependencies_parsed_at":"2023-10-02T23:25:52.737Z","dependency_job_id":"14677c6b-f903-4ddd-9fc1-c92166acefcd","html_url":"https://github.com/losfair/mvsqlite","commit_stats":{"total_commits":194,"total_committers":4,"mean_commits":48.5,"dds":"0.061855670103092786","last_synced_commit":"ec0cb13a9657ae0f503a2a289f5da78ac90fa4d2"},"previous_names":[],"tags_count":55,"template":false,"template_full_name":null,"purl":"pkg:github/losfair/mvsqlite","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/losfair%2Fmvsqlite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/losfair%2Fmvsqlite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/losfair%2Fmvsqlite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/losfair%2Fmvsqlite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/losfair","download_url":"https://codeload.github.com/losfair/mvsqlite/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/losfair%2Fmvsqlite/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31433044,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T08:13:15.228Z","status":"ssl_error","status_checked_at":"2026-04-05T08:13:11.839Z","response_time":75,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["database","rust"],"created_at":"2024-07-31T03:01:22.073Z","updated_at":"2026-04-05T11:01:24.142Z","avatar_url":"https://github.com/losfair.png","language":"Rust","funding_links":[],"categories":["HarmonyOS","Rust"],"sub_categories":["Windows Manager"],"readme":"# mvSQLite\n\nDistributed, MVCC SQLite that runs on top of [FoundationDB](https://github.com/apple/foundationdb).\n\n[Documentation](https://github.com/losfair/mvsqlite/wiki/)\n\n- [mvSQLite](#mvsqlite)\n    - [Features](#features)\n    - [Experimental Features](#experimental-features)\n    - [Releases](#releases)\n    - [Quick reference](#quick-reference)\n    - [Try it](#try-it)\n    - [Contributing](#contributing)\n\n## Features\n\n- **Full feature-set from SQLite**: mvSQLite integrates with SQLite as a custom [VFS](https://www.sqlite.org/vfs.html) layer. It is a layer \"below\" SQLite, and all of SQLite's features are available.\n- **Time travel**: Checkout the snapshot of your database at any point of time in the past.\n- **Lock-free, scalable reads and writes**: Optimistic fine-grained concurrency with [BEGIN CONCURRENT](https://www.sqlite.org/cgi/src/doc/begin-concurrent/doc/begin_concurrent.md)-like semantics. mvSQLite inherits FoundationDB's lock-free property - not a single distributed lock is acquired during data plane operation.\n- **Get the nice properties from FoundationDB, without its limits**: [Correctness](https://apple.github.io/foundationdb/testing.html), [really fast and scalable](https://apple.github.io/foundationdb/performance.html) distributed transactions, synchronous and asynchronous replication, integrated backup and restore. Meanwhile, there's no [five-second transaction limit](https://apple.github.io/foundationdb/known-limitations.html) any more, and a SQLite transaction can be ~39x larger than FDB's native transaction.\n- **Drop-in addition**: Use `LD_PRELOAD` or a patched `libsqlite3.so` to plug mvSQLite into your existing apps. [Read the docs](https://github.com/losfair/mvsqlite/wiki/Integration)\n\n## Experimental Features\n\nThese features are not considered stable yet and should not be used in production without validation.\n\n### Commit Groups\n\nCommit groups let you batch writes from multiple mvSQLite databases into a single FoundationDB commit.\n\nEnable the SQL functions with:\n\n```bash\nexport MVSQLITE_EXPERIMENTAL_COMMIT_GROUP=1\n```\n\nAvailable SQL functions:\n\n- `mv_commit_group_begin()`\n- `mv_commit_group_commit(db_name)`\n- `mv_commit_group_rollback(db_name)`\n\nExample:\n\n```sql\nATTACH 'orders' AS orders;\n\nSELECT mv_commit_group_begin();\n\nBEGIN;\nINSERT INTO main.accounts(id, balance) VALUES (1, 100);\nCOMMIT;\n\nBEGIN;\nINSERT INTO orders.invoices(id, account_id) VALUES (1, 1);\nCOMMIT;\n\nSELECT mv_commit_group_commit('main');\n```\n\nNotes:\n\n- `mv_commit_group_commit(db_name)` and `mv_commit_group_rollback(db_name)` require an explicit SQLite database name such as `'main'` or an attached database name.\n- A commit group commits atomically across all databases that staged an intent in the group: either all staged transactions commit, or none of them do.\n- Staged commit-group writes are not made visible until `mv_commit_group_commit(...)` succeeds.\n- Conflict detection is still performed per database against that database's own read set / last-write version, so ordinary concurrent write conflicts on touched rows or pages still abort the group.\n- Commit groups do not provide a shared cross-database snapshot. Different databases in the same group may read from different committed versions before staging their writes.\n- As a result, commit groups are suitable for \"all-or-nothing across databases\" workflows such as debit in one database and credit in another, but they do not provide cross-database serializability for invariants that depend on reading multiple databases from one coherent snapshot.\n- A commit-group conflict is returned as a SQLite `SQLITE_PERM` error.\n- After the first grouped commit is staged, no new transaction may begin in the same group.\n\n## Releases\n\nGrab the latest binaries from the [Releases](https://github.com/losfair/mvsqlite/releases) page. You can also [build your own binaries](#contributing) to run on a platform other than x86-64.\n\n## Quick reference\n\nCheck the single-page [mvSQLite Quick Reference](https://blob.univalent.net/mvsqlite-quick-reference-v0-2.pdf) for common operations with mvSQLite.\n\n## Try it\n\nInstall FoundationDB:\n\n```bash\nwget https://github.com/apple/foundationdb/releases/download/7.3.69/foundationdb-clients_7.3.69-1_amd64.deb\nsudo dpkg -i foundationdb-clients_7.3.69-1_amd64.deb\nwget https://github.com/apple/foundationdb/releases/download/7.3.69/foundationdb-server_7.3.69-1_amd64.deb\nsudo dpkg -i foundationdb-server_7.3.69-1_amd64.deb\n```\n\nDownload the binaries:\n\n```bash\ncurl -L -o ./libmvsqlite_preload.so https://github.com/losfair/mvsqlite/releases/download/v0.2.1/libmvsqlite_preload.so\ncurl -L -o ./mvstore https://github.com/losfair/mvsqlite/releases/download/v0.2.1/mvstore\nchmod +x ./mvstore\n```\n\nRun `mvstore`, the server-side half that should be colocated with the FoundationDB cluster in production:\n\n```bash\nRUST_LOG=info ./mvstore \\\n  --data-plane 127.0.0.1:7000 \\\n  --admin-api 127.0.0.1:7001 \\\n  --metadata-prefix mvstore \\\n  --raw-data-prefix m\n```\n\nCreate a namespace with the admin API:\n\n```bash\ncurl http://localhost:7001/api/create_namespace -i -d '{\"key\":\"test\"}'\n```\n\nBuild `libsqlite3` and the `sqlite3` CLI: (note that a custom build is only needed here because the `sqlite3` binary shipped on most systems are statically linked to `libsqlite3` and `LD_PRELOAD` don't work)\n\n```bash\nwget https://sqlite.org/2026/sqlite-amalgamation-3510300.zip\nunzip sqlite-amalgamation-3510300.zip\ncd sqlite-amalgamation-3510300\ngcc -O2 -fPIC --shared -o libsqlite3.so ./sqlite3.c -lpthread -ldl -lm\ngcc -O2 -o sqlite3 ./shell.c -L. -lsqlite3\n```\n\nSet environment variables, and run the shell:\n\n```bash\nexport RUST_LOG=info MVSQLITE_DATA_PLANE=\"http://localhost:7000\"\n\n# \"test\" is the key of the namespace we created earlier\nLD_PRELOAD=../libmvsqlite_preload.so LD_LIBRARY_PATH=. ./sqlite3 test\n```\n\nYou should see the sqlite shell now :) Try creating a table and play with it.\n\n## Contributing\n\nmvsqlite can be built with the standard Rust toolchain:\n\n```bash\ncargo build --release -p mvstore\ncargo build --release -p mvsqlite\nmake -C mvsqlite-preload\n```\n\nInternals are documented in the [wiki](https://github.com/losfair/mvsqlite/wiki).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flosfair%2Fmvsqlite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flosfair%2Fmvsqlite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flosfair%2Fmvsqlite/lists"}