AI NewsDev toolsAnnouncement

sqlite-multiwriter lets 16 threads write one SQLite database 5.7x faster

sqlite-multiwriter is an SQLite extension that lets threads and processes commit to the same database at the same time without changing SQLite or your schema; the README's own benchmark on 16 threads reports 49,277 transactions a second against 8,630 for stock SQLite, with slowest commits dropping from 157 to 2.08 milliseconds.

AI News

Editorial2 min read

LinkedInX
GitHub social card for the sqlite-multiwriter repository

Image: GitHub

Why it mattersAny team using SQLite as a server-side store, including behind an AI feature with many concurrent writers, has had to serialise writes or move to Postgres; a VFS extension that leaves the file format alone changes which of those is the right answer.

A sixteen-thread write test on one SQLite database hits 49,277 commits a second with sqlite-multiwriter on, against 8,630 with stock SQLite. The slowest one in a thousand commits lands in 2.08 milliseconds instead of 157. The numbers come from the project's own README on a new repository from the sqliteai organisation, published on 8 October 2026 under Apache 2.0 and sitting at 128 stars three days later.

The piece is an SQLite extension: no fork, no schema change, no new SQL. The README puts its one line as "Concurrent SQLite writes across threads and processes without modifying SQLite." It is a VFS, SQLite's file-system layer, which gives it enough to split WAL files per writer and resolve conflicts at commit time without any change to the engine above it.

How the writes do not fight each other

Every writer gets its own WAL (write-ahead log) file and takes a snapshot of the database when a transaction begins. The writer makes its edits against that snapshot. When it commits, the engine checks whether any other writer has already changed the pages this transaction read. If no one has, the commit lands. If someone has, the writer gets SQLITE_BUSY_SNAPSHOT back and runs the transaction again. The README's benchmark on sixteen threads inserting their own rows measured 0.2 retries per 100 transactions, against 189 for stock SQLite.

A rebase feature covers the common case where two writers change different rows that happen to sit on the same page. The engine does not refuse the losing commit; it takes the row changes of that transaction and replays them on the latest state, then commits. A real conflict, the same row written by both, still fails. The README warns that rebase does not apply when a transaction read rows, used DDL, touched a trigger or virtual table, or used AUTOINCREMENT, since every insert there writes the same row of sqlite_sequence.

What it does not cover

The limits are set out plainly. The extension requires WAL mode: journal modes other than WAL, locking_mode=EXCLUSIVE and most auto_vacuum settings are not supported. It does not run on a network file system. The database file is only usable through the engine while it is open, because the file now travels with per-writer log files. The isolation level is snapshot with first-committer-wins, so write skew is still possible on a few patterns the README lists. A reader that never ends holds back the collection of old page versions, and the index of versions has a fixed size: when a backlog builds, a commit returns SQLITE_FULL.

Vendored SQLite is version 3.53.4, in the public domain as SQLite always is. The extension itself takes Apache 2.0. SQLite 3.14 or newer is enough to load it.

Source

sqlite-multiwriter, sqliteai on GitHub.

This item was written by an AI system from the linked source. Reveneau is responsible for what it publishes.

Share
LinkedInX
Start a project