The newest release is a January 2024 build
Convergent, Replicated SQLite. Multi-writer and CRDT support for SQLite
At a glance
- What is it?
- cr-sqlite is a loadable SQLite extension that merges databases which took independent writes, using CRDTs instead of manual conflict resolution. Its documented surface is short, its binary has not been cut since January 2024, and two of its own SQL snippets disagree about the name of a table and a function.
- Who is it for?
- cr-sqlite fits an offline-first application where two devices genuinely both write and neither can ask the other first, because that is the case its merge machinery is built for. Three things to weigh before adopting it.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 97 days ago.
- What is it written in?
- Mainly Rust, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.
Star history
- vlcn-io/cr-sqlite3,830 ★ · +30
| Repository | 2026-09-24 | 2026-11-15 |
|---|---|---|
| vlcn-io/cr-sqlite | 3.8k | 3.8k |
30 Stars in the last 52 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
The newest tag is v0.16.3 from January 2024
The release history stops well before the commits do. The three most recent tags are v0.16.3 published 2024-01-17, v0.16.2 on 2024-01-06 and v0.16.1 on 2023-12-16, and the last push to the default branch main is dated 2026-08-10. So there are roughly two and a half years of changes on main that no tag covers. That matters because of how the project is distributed. The Packages section says pre-built binaries of the extension are available in the releases section, and gives the exact command an image build uses to obtain one, which resolves the latest release rather than the branch. Anyone installing today from a binary therefore gets the January 2024 build, and anyone wanting the current source has to compile it. The four CI badges in the header do suggest the tree itself is exercised: C tests, Valgrind, Python tests and Rust tests.
One function is written two ways in the same block
The third API in the list is the table-alteration pair, and its own documentation cannot decide what the second one is called. The heading names them `crsql_begin_alter('table_name')` and `crsql_alter_commit('table_name')`. The SQL example three lines below calls the same pair with the words the other way round:
SELECT crsql_begin_alter('table_name');
-- 1 or more alterations to `table_name`
ALTER TABLE table_name ...;
SELECT crsql_commit_alter('table_name');crsql_alter_commit and crsql_commit_alter are not interchangeable, and the file explains why the awkwardness exists at all: until the syntax of SQLite is extended to be aware of replicated relations, altering one looks like this, and a future version may extend the SQL syntax to make it more natural. The reason given is good. The reason the example disagrees with the heading is that one of them was edited without the other.
The usage example queries a table the API never defines
The three APIs are named explicitly. crsql_as_crr is a function extension that upgrades existing tables to crrs. crsql_changes is a virtual table you select to get changesets and insert into to apply patches from another database. The usage section then opens a connection, loads the extension, sets the output mode, creates two ordinary tables, upgrades both with crsql_as_crr, inserts a row into each, and finishes with the query that asks what changed. That final line selects from crsql, not from crsql_changes:
select "table", "pk", "cid", "val", "col_version", "db_version", "site_id", "cl", "seq" from crsqlThe column list matches the one documented for crsql_changes, so the intent is clear, but the relation named in the working example is not the relation the API section defines. The rest of the section is careful about the difference that matters: local changes are read with site_id = crsql_site_id(), while a peer's changes are read with site_id != some_site_id, which is how you avoid feeding a peer its own writes back.
History-free is the tradeoff, and it is the whole tradeoff
The project describes itself in one line as like Git, for your data, and then explains what that does not include. There are two approaches with very different tradeoffs, both of which the project says will eventually be supported; v1 and the current releases implement the first, and v2 will support both. Approach 1 is history-free, and its properties are listed as four items: it keeps no history and only the current state, it handles merge conflicts automatically with no option for manual merging, its tables are Grow Only Sets or variants of Observe-Remove Sets, and its rows are maps of CRDTs. Dropping history is what buys the automatic merge, since there is nothing to reconcile. It also means there is no log to replay, no diff between two points in time, and no audit trail that survives a peer, which is the part worth weighing against the Git analogy.
Inserts are 2.5x slower and the numbers live in a notebook
The performance section is two lines and a link. The link goes to a notebook in the Python directory, py/perf/perf.ipynb, and the two lines say that inserts into CRRs are currently 2.5x slower than inserts into regular SQLite tables, and that reads are the same speed. No SQLite version, no hardware, no row width and no concurrency figure appear next to that multiple, so the honest way to read it is as a shape rather than a benchmark: writes pay for the metadata the merge needs, reads do not. That is a reasonable place for a replicated layer to sit, since applications write on interaction and read constantly, but a project evaluating this should run the notebook rather than quote the ratio.
Loading the extension is the first thing you do, every time
The distribution model is a loadable extension rather than a library, which is why the documentation spends a paragraph on a single call. The entry point into the shared object is named, so you either pass that name to SQLite's load_extension or rename the binary to match the platform's extension:
load_extension(extension_path, 'sqlite3_crsqlite_init')The note attached to it is the part that bites. If you use cr-sqlite as a run-time loadable extension, loading it should be the first operation you do after opening a connection to the database, and the extension needs to be loaded on every connection you create. A connection pool that opens connections lazily therefore has replicated tables that silently are not replicated, and nothing in the type system will tell you. Pre-built binaries load from any language with SQLite bindings, and browser and React users are pointed at a separate js directory that also holds the WASM build.
A committed .env and a Makefile that only delegates
The repository is small at the top level: core/, py/, a Makefile, notes.md, libsql-sync.sh, a .gitmodules, and a .env file that is committed rather than ignored. The build file is twelve lines and none of them compile anything. It declares a git dependency on a submodule path, updates submodules recursively before building, and exports one variable to every sub-make:
all: crsqlite
crsqlite: $(git-deps)
cd core; \
make loadableThe exported variable is CRSQLITE_NOPREBUILD set to 1, which tells the inner build not to fetch or rebuild its own dependency, and the real work is the make loadable target in core. So the top-level Makefile exists to sequence submodule initialisation and to pass one flag down, which is a thin but reasonable arrangement. The committed environment file is the entry worth a second look, since it means whatever is in it is in the repository for every clone.
Five companies and five individuals are listed as sponsors
The sponsorship section is short and split in two. Five companies are linked by logo, among them turso.tech, fly.io, reflect.app, expo.dev and electric-sql.com, followed by five individuals including two whose names are also on the Rust or SQLite projects this work sits next to. What the section does not do is tie any of it to a roadmap, a maintainer commitment or a support promise, so it reads as a funding page rather than a governance one. The surrounding links point the same way: a Discord invite, a tutorials page on the vulcan documentation site, and a set of example applications maintained in other repositories, from a Vite starter and a TodoMVC to a Svelte store and a notebook walkthrough of the basic setup.
Editorial conclusion
cr-sqlite fits an offline-first application where two devices genuinely both write and neither can ask the other first, because that is the case its merge machinery is built for. Three things to weigh before adopting it. It keeps no history, so there is no log to replay and no audit trail across peers. The current line is history-free and the version that supports the other approach does not exist yet. And the binary you can download is two and a half years old, so a build from source is the realistic starting point.
Frequently asked questions
What is cr-sqlite?
A run-time loadable extension for SQLite and libSQL that adds multi-master replication and partition tolerance through conflict-free replicated data types and causally ordered event logs, so databases that took independent writes can be merged. The README describes it as like Git, for your data, and lists syncing between devices, realtime collaboration, offline editing, resilience to network conditions and instantaneous interactions as the cases it targets.
How much slower is cr-sqlite than plain SQLite?
The README states that inserts into CRRs are 2.5x slower than inserts into regular SQLite tables and that reads are the same speed. The measurement it points to is the notebook py/perf/perf.ipynb, and no SQLite version or hardware is given alongside the figure.
How does cr-sqlite expose changes to an application?
Through a virtual table named crsql_changes, selected to read changesets and inserted into to apply patches received from another peer. Rows carry table, pk, cid, val, col_version, db_version, site_id, cl and seq, and local changes are selected with site_id = crsql_site_id() while a peer's are selected with site_id != some_site_id.
How do you upgrade an existing SQLite table in cr-sqlite?
With the crsql_as_crr function extension, called as SELECT crsql_as_crr('table_name'). Altering a table after that requires the pair crsql_begin_alter and a commit step, which the README writes as crsql_alter_commit in the heading and as crsql_commit_alter in the SQL example.
How is the cr-sqlite extension loaded into SQLite?
Its entry point is named sqlite3_crsqlite_init, which you pass to load_extension, or you rename the binary to crsqlite with the platform's extension. The README notes that loading it should be the first operation after opening a connection and that it has to be loaded on every connection you create.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/vlcn-io-cr-sqlite)Star history chart for your README
[](https://hysenlabs.com/projects/vlcn-io-cr-sqlite)Was this useful?