Skip to main content
Turso with default configuration only allows one connection to write at a time. With MVCC (Multi-Version Concurrency Control), multiple connections can write simultaneously. If two transactions modify the same data, one will receive a conflict error and must roll back and retry.

Enable MVCC

Set the journal mode on your database connection:

BEGIN CONCURRENT

Use BEGIN CONCURRENT instead of BEGIN to start a transaction that allows other writers to proceed in parallel:
If two transactions touch the same rows, one will receive a conflict error and must roll back and retry. Transactions that write to non-overlapping data proceed without conflict.

Handling Conflicts

Your application must detect conflict errors and retry the transaction.

Example

Try the full example: Rust · JavaScript · Python