SQLite’s long-standing single-writer constraint is addressed by sqlite-multiwriter, a drop-in solution that requires no changes to SQLite itself or existing databases. It implements a custom SQLite Virtual File System (VFS) that gives each writer an independent snapshot and a private write-ahead log; on commit the engine validates changes, publishes compatible updates, and uses an optional page-level rebase to reconcile non-overlapping modifications. The design meets four constraints the author set: full compatibility with existing databases, no SQLite source modifications, support for both multithreading and multiprocessing, and transparent use of standard SQLite APIs and SQL.
Benchmarks show large gains on insert-heavy workloads: with 16 concurrent threads transactions/sec rose from 8,630 to 49,277 (5.7x) and p99.9 latency dropped from 157 ms to 2.08 ms; with 16 processes throughput went from 8,636 to 25,987 (3.0x) and p99.9 latency from 233 ms to 1.54 ms. The approach still requires retries on genuine conflicts and results vary by workload, but it substantially reduces unpredictable waiting and tail latency - important for AI-agent-heavy and high-concurrency applications. The project is open-source under Apache 2.0, with benchmarks, methodology, and source available for testing and community contributions.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.