Runtime-enabled multi-version concurrency control with snapshot isolation and a logical log for SQLite-style databases.

skills.sh installs
1.2K
GitHub stars
25.3K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers enabling MVCC per database with PRAGMA journal_mode = 'mvcc', row-level versions, and how it differs from WAL
  • Explains row version timestamps, the logical log replayed on restart, and checkpoint and garbage collection pragmas
  • Notes limitations: snapshot isolation rather than serializability, wal_checkpoint(TRUNCATE) blocking readers, and in-memory row versions
  • Designed for developers isolating bugs that reproduce only with MVCC on, using cargo test mvcc and #[turso_macros::test(mvcc)]

Install

$ npx -y skills add tursodatabase/turso --skill mvcc -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

MVCC

Multi-version concurrency control, enabled per database:

PRAGMA journal_mode = 'mvcc';

It is a runtime setting, not a compile-time feature flag. Most bugs are not MVCC-specific, so rule MVCC out first unless the bug only reproduces with journal_mode=mvcc.

Differences from WAL

AspectWALMVCC
Commit writesFull pagesAffected rows only
Readers and writersDo not block each otherDo not block each other
Persistence.db-wal.db-log (logical log), replayed on restart
IsolationSnapshot (page level)Snapshot (row level)

MVCC gives snapshot isolation, not serializability. The module docs in core/mvcc/ describe the data anomalies.

Each row version has a begin timestamp (when it becomes visible), an end timestamp (when it is deleted or replaced) and a flag saying the row already existed in the B-tree before MVCC wrote it.

Checkpointing and garbage collection

Details

Repository
github.com/tursodatabase/turso
Categories
Databases, Debugging
First seen
May 16, 2026

More from tursodatabase/turso

All 7

Similar to Mvcc

More Databases