> ## Documentation Index
> Fetch the complete documentation index at: https://docs.turso.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Concurrent Writes on Turso Cloud

> Run transactions with BEGIN CONCURRENT on Turso Cloud so multiple writers proceed in parallel. Currently in beta.

> [!NOTE]
>
> Concurrent writes on Turso Cloud are in beta because they were added to Turso Cloud recently. The label reflects the Cloud offering, not the engine: concurrent writes (MVCC and `BEGIN CONCURRENT`) are production ready in [Turso Database](https://docs.turso.tech/tursodb/concurrent-writes.md).

With concurrent writes, transactions started with `BEGIN CONCURRENT` let multiple writers proceed in parallel instead of waiting for a single write lock. Conflicts are detected at the row level: transactions that write to different rows commit without blocking each other.

## Requirements

Concurrent writes require a Turso database, which uses the Turso Database engine rather than libSQL. Create one with:

```bash theme={null}
turso db create --tursodb my-database
```

Turso databases on Turso Cloud are an opt-in beta. See [Feature status](https://docs.turso.tech/feature-status.md).

## Use BEGIN CONCURRENT

Start the transaction with `BEGIN CONCURRENT` instead of `BEGIN`:

```sql theme={null}
BEGIN CONCURRENT;
UPDATE inventory SET quantity = quantity - 1 WHERE item_id = 42;
INSERT INTO orders (item_id, customer_id) VALUES (42, 7);
COMMIT;
```

Connect with the Turso serverless drivers: [`@tursodatabase/serverless`](https://docs.turso.tech/sdk/ts/quickstart) for TypeScript, `turso_serverless` for Python and Rust.

## Handle conflicts

If two concurrent transactions write to the same rows, one of them fails with a conflict error. Your application should catch the error, roll back, and retry the transaction. See [Handling Conflicts](https://docs.turso.tech/tursodb/concurrent-writes.md#handling-conflicts) for retry examples.

## Related

* [Concurrent Writes in Turso Database](https://docs.turso.tech/tursodb/concurrent-writes.md): how MVCC and `BEGIN CONCURRENT` work in the engine
* [Feature status](https://docs.turso.tech/feature-status.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.