TursoDB vs SQLite
Async Rust rewrite with concurrent MVCC writes and native cloud sync vs. the battle-tested C original.
Engineering Verdict
SQLite remains the gold standard for single-writer local persistence with 25+ years of hardening. TursoDB keeps the SQLite file format and SQL dialect while replacing blocking C I/O and the global write lock with async Rust, MVCC concurrent writes, built-in vector search, and first-class local-to-cloud sync.
TursoDB is a ground-up Rust rewrite compatible with SQLite files and SQL semantics. Rather than bolting extensions onto the C library, it re-architects I/O (io_uring), transaction concurrency (BEGIN CONCURRENT), vector indexing, and sync replication directly into the core engine.
Side-by-Side Technical Matrix
Verified Real-Hardware Benchmarks
VERIFIED RUNConcurrent Read-Compute(2ms)-Write TX @ 16w (bun 1.4.5)
Higher is better · tx/sDurable Append Throughput — Verified FULL Sync (bun 1.4.5)
Higher is better · ops/sFull-Table Decrypt Scan Latency (50,000 rows · fresh open median)
Lower is better · msNative Primary-Key Point Lookup p99 (2,000 verified queries · Prepared)
Lower is better · ms- Under 16-worker Read-Compute(2ms)-Write transactions (verified PRAGMA synchronous=FULL on both engines), TursoDB BEGIN CONCURRENT reached 1,794.6 tx/s (p99 44.9 ms, 0% retries) vs bun:sqlite BEGIN IMMEDIATE at 261.6 tx/s (p99 933.2 ms)—6.9× higher throughput and 20.8× lower tail latency (5.0× on Node.js).
- Under equal FULL-fsync concurrent appends with hoisted prepared statements, TursoDB MVCC outperformed SQLite WAL across 1/4/8/16 workers (at 16w: 2,399 vs 1,464 ops/s on Bun, 2,406 vs 1,403 ops/s on Node.js) with 5.0×–5.5× lower p99 latency.
- With zero JS/FFI overhead in native Rust (--release), TursoDB 0.8.4 matched C SQLite 3.54.1 within 0.3 µs on verified PK point lookups (0.0017 ms vs 0.0014 ms p99), while C SQLite remained faster on single-thread 50k batch inserts (2.76M vs 696k rows/s).
- On Xeon AES-NI hardware (~21.8 MB DB), native AEGIS-256 decrypted full-table scans 1.65× faster than AES-256-GCM (20 ms vs 33 ms; plaintext 14 ms) with zero plaintext leakage on disk and 100% keyless open rejection.
bash benchmarks/run-suite.sh --only e1,e4,e7 --runtime all View full 8-scenario Real-Hardware Benchmarks Hub →
How to Choose
- Your workload hits SQLITE_BUSY under concurrent writes and needs optimistic MVCC (BEGIN CONCURRENT).
- You want built-in local-to-cloud sync or embedded replicas without operating separate replication daemons.
- You are building AI agents or RAG apps that need native vector search alongside relational state in one file.
- You want memory-safe Rust internals and non-blocking async I/O that integrates cleanly with modern runtimes.
- You need 25+ years of production hardening, formal test-suite guarantees, and zero risk of edge-case SQL divergence.
- Your application is strictly local with low write concurrency where single-writer WAL is already more than fast enough.
- You depend on niche C-API SQLite extensions, custom virtual tables, or system-preinstalled libsqlite3 binaries.
- You require public-domain licensing with minimal binary footprint (~1 MB) on constrained embedded hardware.
Architectural Deep Dive
Breaking the Single-Writer Ceiling with Async Rust
Classic SQLite serializes all write transactions behind a single file lock—even in WAL mode—and blocks calling threads during disk flushes. TursoDB replaces that path with an asynchronous I/O engine (supporting io_uring on Linux) and MVCC page versioning, allowing non-conflicting transactions started with BEGIN CONCURRENT to commit concurrently without stalling event loops.
File Compatibility vs. Built-In Cloud Mechanics
Because TursoDB targets the standard SQLite file format and SQL grammar, teams can adopt it incrementally without rewriting schemas or ORMs. The difference appears once data leaves one machine: SQLite leaves backup streaming, edge reads, and offline conflict sync to external tooling, whereas TursoDB builds pull/push synchronization directly into its client SDKs.
Code Comparison
import { connect } from '@tursodatabase/database';
const db = await connect('agent.db');
await db.exec('BEGIN CONCURRENT');
await db.prepare('INSERT INTO events (kind, payload) VALUES (?, ?)').run('sync', '{}');
await db.exec('COMMIT'); import Database from 'better-sqlite3';
const db = new Database('local.db');
db.pragma('journal_mode = WAL');
const stmt = db.prepare('INSERT INTO events (kind, payload) VALUES (?, ?)');
stmt.run('local', '{}'); Developer FAQ
Can TursoDB open existing SQLite .db files?
Yes. TursoDB is designed for binary file-format and SQL compatibility with SQLite, so existing local SQLite databases can be read and migrated with standard tools and drivers.
Does TursoDB require Turso Cloud, or can it run purely locally like SQLite?
It runs purely locally with zero network dependencies. Cloud sync and embedded replicas are strictly opt-in when you need remote durability or multi-device distribution.
When is standard SQLite still the better choice?
For single-writer local apps, CLI tools, or environments requiring legacy C extensions and decades-old ABI stability, upstream SQLite remains simpler and more battle-tested.
Test TursoDB in Your Own Stack
Open a local SQLite-compatible file in Rust, TypeScript, Python, or Go—then attach cloud sync when you need multi-region replication.
Related Comparisons
Portable open-source engine with offline local-first sync vs. serverless SQLite coupled to Cloudflare Workers.
In-process per-tenant simplicity and local-first sync vs. the full-featured relational server powerhouse.
Zero-daemon embedded Rust & edge sync vs. the ubiquitous InnoDB client-server workhorse.
Lightweight embedded Rust & local-first sync vs. full-featured server RDBMS with Galera and HNSW vectors.