mvcc
Experimental multi-version concurrency control with row-level snapshot isolation for SQLite-compatible databases.
- Enables per-transaction snapshot isolation where readers and writers don't block each other; enabled via
PRAGMA journal_mode = 'mvcc'on a per-database basis - Tracks row versions with begin/end timestamps and uses a logical log (
.db-log) instead of WAL for persistence; includes configurable checkpointing viaPRAGMA mvcc_checkpoint_threshold - Architecture uses lock-free
SkipMapstructures for row versions and transactions, with per-connection transaction tracking and a sharedMvStore - Current limitations: garbage collection not implemented, no recovery from logical log on restart, checkpointing blocks all transactions, and memory use concerns without disk spilling
- Provides snapshot isolation only, not serializability; marked work-in-progress and not production-ready
MVCC Guide (Experimental)
Multi-Version Concurrency Control. Work in progress, not production-ready.
CRITICAL: Ignore MVCC when debugging unless the bug is MVCC-specific.
Enabling MVCC
PRAGMA journal_mode = 'mvcc';
Runtime configuration, not a compile-time feature flag. Per-database setting.
How It Works
Standard WAL: single version per page, readers see snapshot at read mark time.
MVCC: multiple row versions, snapshot isolation. Each transaction sees consistent snapshot at begin time.
More from tursodatabase/turso
code-quality
General Correctness rules, Rust patterns, comments, avoiding over-engineering. When writing code always take these into account
1.0Kindex-knowledge
Generate hierarchical AGENTS.md knowledge base for a codebase. Creates root + complexity-scored subdirectory documentation.
657debugging
How to debug tursodb using Bytecode comparison, logging, ThreadSanitizer, deterministic simulation, and corruption analysis tools
631async-io-model
Explanations of common asynchronous patterns used in tursodb. Involves IOResult, state machines, re-entrancy pitfalls, CompletionGroup. Always use these patterns in `core` when doing anything IO
604storage-format
SQLite file format, B-trees, pages, cells, overflow, freelist that is used in tursodb
604testing
How to write tests, when to use each type of test, and how to run them. Contains information about conversion of `.test` to `.sqltest`, and how to write `.sqltest` and rust tests
598