Register now for early access to concurrent writes in the Turso Cloud. Join the waitlist
Turso is an open-source, SQLite-compatible database written in Rust that lets developers create millions of small, file-based databases for AI agents, multi-tenant SaaS applications, and edge workloads. Unlike traditional databases that run as a single shared server process, Turso treats each database as a lightweight file that can be spun up instantly, replicated globally, or synced to a device.
Category
Distributed SQL database, SQLite-compatible
Created by
Turso, Inc
Written in
Rust
License
MIT
Compatible with
SQLite SQL dialect, file format and C API
Hosting Model
Self-hosted (Turso Database) or managed (Turso Cloud)
Built-in features
Vector Search, async I/O, concurrent writes, replication
Primary Use cases
AI Agent memory, per-tenant SaaS, edge apps, local-first apps
The many-database architecture
Turso departs from the conventional database model in one decisive way: a database is a file, not a long-running server process.
In a traditional database such as PostgreSQL or MySQL, all tenants, users, and applications typically share a single instance. Scaling means giving that instance more CPU, more memory, or more replicas.
Turso flips the model. Every user, tenant, or AI agent can have its own dedicated database, and an idle database costs only its storage footprint, because there is no process running when nobody is querying it.
Because each Turso database is a file rather than a process, there are no cold starts and no wake-up penalty. The database is always available the moment it is needed. This makes the model practical at scale: Turso Cloud is designed to host millions or even billions of small databases, where most of them are idle most of the time.
In Turso Cloud, durability is handled by Amazon S3 and S3 Express. Database files are split into 128 kB segments, and the collection of segments that make up a file is called a generation. When a write transaction is committed, the write-ahead log (WAL) is persisted to S3 Express before the transaction is acknowledged.
This produces three useful properties:
Eleven nines of data durability
Turso Cloud inherits AWS S3 durability guarantees of 99.999999999%, with continuous backups and point-in-time restore up to 90 days.
Instant copy-on-write branches
Branching a database is a metadata-only operation. New branches share existing segments until they diverge, so creating a branch is effectively instant.
Lazy fetch and replication
When a database is moved or replicated, segments are pulled on demand. The destination starts serving queries before the full file has arrived.
No process, no scale-to-zero
There is nothing to scale to zero. An idle database is simply a set of files in object storage and costs only storage, not compute.
What sets it apart from vanilla SQLite
Turso is described by its maintainers as a ground-up rewrite of SQLite in Rust, intended as a drop-in replacement. The rewrite adds capabilities that classical SQLite does not offer out of the box.
Concurrent writes via MVCC
Turso introduces BEGIN CONCURRENT for improved write throughput using multi-version concurrency control (MVCC). Classical SQLite serializes writes; Turso allows multiple writers to make progress at once.
Native vector search
Vector similarity search is built into the database. No extensions are required. This makes Turso a practical store for embeddings used in retrieval-augmented generation (RAG) and other AI workloads, including on-device RAG.
Async I/O Architecture
Turso is built with an async-first I/O model, which suits both serverless runtimes and edge environments where blocking I/O is expensive or unavailable.
Browser and WebAssembly support
Turso can run in the browser through WebAssembly, which makes it usable in client-side applications, sandboxed agent runtimes, and other environments where embedding a database directly is desirable.
Native Encryption
Native encryption at the page level for security-oriented use cases. No extensions. With the Turso Cloud, encrypt each database at rest with your key with the BYOK model.
Change Data Capture, Full Text Search, and more.
Recent and experimental additions include change data capture (CDC) for tracking database changes in real time, full-text search powered by the Tantivy library, a strong type system, and incremental view maintenance using DBSP.
Five common workloads
AI agent memory and state
Each AI agent gets its own database to track files, store memories, log actions, and coordinate tasks. Because branching is instantaneous, agents can fork their state, try something, and roll back if it fails.
Multi-tenant SaaS applications
Per-tenant databases give each customer hard data isolation without paying the full cost of a dedicated server. This pattern is well-suited to platforms that need fast onboarding, custom schemas per tenant, or data residency in specific jurisdictions.
Edge applications with low-latency reads
Replicas can be placed in regions close to users so reads are served at edge latency. Useful for product catalogs, user settings, cache layers, and similar read-heavy workloads.
Local-first and offline-capable apps
An embedded replica syncs with the cloud on demand, so applications can write locally while offline and reconcile later. This pattern is common in mobile, desktop, and IoT apps.
On-device retrieval-augmented generation
With native vector search and small file-based databases, embeddings and source documents can live directly on a phone, laptop, or other device, enabling private RAG without round-tripping to a server.
How the model differs
Turso is most commonly compared to SQLite, since it is positioned as a SQLite-compatible drop-in. It is also worth contrasting with traditional client-server databases such as PostgreSQL.
| Dimension | Turso | SQLite | PostgreSQL |
|---|---|---|---|
| Architecture | In-process plus cloud, file-based | In-process, file-based | Client-server |
| Language | Rust | C | C |
| Concurrent Writes | Yes, MVCC | No, Serialized Writer | Yes, MVCC |
| Vector Search | Native, built-in | Via extensions | Via pgvector extension |
| Many-database scale | Millions of databases | Manual, one file each | Not designed for it |
| Cold start | None | None | Process must be running |
| Cloud Option | Turso Cloud | None first-party | Many providers |
| License | MIT | Public Domain | PostgreSQL License |
Creating and querying a Turso database
A minimal Turso Cloud workflow uses the Turso CLI to create a database, then a client library to query it. The example below shows a Node.js client using the official libSQL client.
import { createClient } from "@tursodatabase/api";
const turso = createClient({
org: process.env.TURSO_ORG!,
token: process.env.TURSO_PLATFORM_TOKEN!,
});
// Create a database
const db = await turso.databases.create("user-abc123", { group: "default" });import { connect } from '@tursodatabase/serverless';
const conn = connect({
url: process.env.TURSO_DATABASE_URL,
authToken: process.env.TURSO_AUTH_TOKEN,
});
// Prepare a statement
const stmt = conn.prepare('SELECT * FROM users WHERE id = ?');
// Get first row
const row = await stmt.get([123]);
console.log(row);Using Turso as an Embedded database is obviously free. The Turso Cloud architecture with millions of databases as lightweight isolated files, not processes, allow us to offer the most generous free plans in the market. 100 databases for free.
All paid Turso Cloud plans offer unlimited databases. Our Developer plan starts from $4.99 a month and caters to individual developers building their AI applications. The Scaler plan helps small teams scale, and the Pro plan is designed for secure and compliant production workloads.
Direct answers
Spin up your first database in under a minute on the free Starter plan, or fork the open-source Turso Database on GitHub.