# TursoDB vs SQLite

> 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.
> Canonical HTML: https://tursodb.cn/compare/turso-vs-sqlite/
> Language: en
> SQLite Official Site: https://www.sqlite.org/

## Overview
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.

## Comparison Matrix
| Dimension | TursoDB | SQLite |
| :--- | :--- | :--- |
| Core Engine | Pure Rust async engine — SQLite-compatible rewrite with non-blocking io_uring I/O on Linux | Mature C library — Synchronous blocking POSIX and Win32 file I/O |
| Deployment Model | Embedded + cloud sync — In-process library with optional sync or managed Turso Cloud | Local file library only — Strictly in-process; networking requires external proxies or wrappers |
| Concurrency & Writes | MVCC concurrent writes — Optimistic BEGIN CONCURRENT writers without blocking active readers | WAL single-writer lock — Concurrent writers serialize or hit SQLITE_BUSY under contention |
| Sync & Edge Replication | Native bidirectional sync — Built-in local-to-cloud sync and embedded read replicas | No built-in sync — Relies on Litestream, LiteFS, or custom external replication |
| Multi-Tenant Isolation | Native database-per-tenant — Low idle overhead locally and across managed Turso Cloud | Local files only — Per-tenant files work locally, but routing and backups are DIY |
| Vector & AI Search | Built-in DiskANN vectors — Native vector types and ANN similarity search included | Extension-only vectors — No built-in index; requires external extensions like sqlite-vec |
| SQL Dialect & Ecosystem | SQLite-compatible polyglot SDKs — Standard file format with Rust, JS/TS, Python, Go, C, and WASM | Universal reference SQLite — Ubiquitous dialect supported by virtually every language and OS |
| License | MIT permissive license — Open-source core free for commercial embedding and self-hosting | Public Domain dedication — Free to embed anywhere with optional paid commercial warranty |

## Verified Real-Hardware Benchmarks
> Environment: Intel(R) Xeon(R) E-2288G CPU @ 3.70GHz (8c) · kvm · Linux 6.8.0-147-generic · io_uring=ENABLED · Turso 0.8.4 · Recorded 2026-12-05T19:14:15Z

### Concurrent Read-Compute(2ms)-Write TX @ 16w (bun 1.4.5) (higher is better)
| Engine / Series | Value | Notes |
| :--- | :--- | :--- |
| TursoDB BEGIN CONCURRENT · 16w | 1794.6 tx/s | p99 44.894ms · retries 0% |
| bun:sqlite (WAL FULL) BEGIN IMMEDIATE · 16w | 261.6 tx/s | p99 933.177ms · busy 170 |

### Durable Append Throughput — Verified FULL Sync (bun 1.4.5) (higher is better)
| Engine / Series | Value | Notes |
| :--- | :--- | :--- |
| TursoDB MVCC · 1w (bun 1.4.5) | 2852.8 ops/s | sync=2 · retries 0% |
| bun:sqlite (WAL FULL) · 1w | 2462.6 ops/s | sync=2 · busy 0 |
| TursoDB MVCC · 4w (bun 1.4.5) | 2700 ops/s | sync=2 · retries 0% |
| bun:sqlite (WAL FULL) · 4w | 2141.1 ops/s | sync=2 · busy 14 |
| TursoDB MVCC · 8w (bun 1.4.5) | 2792.6 ops/s | sync=2 · retries 0% |
| bun:sqlite (WAL FULL) · 8w | 2430.6 ops/s | sync=2 · busy 26 |
| TursoDB MVCC · 16w (bun 1.4.5) | 2399.2 ops/s | sync=2 · retries 0% |
| bun:sqlite (WAL FULL) · 16w | 1463.9 ops/s | sync=2 · busy 89 |

### Full-Table Decrypt Scan Latency (50,000 rows · fresh open median) (lower is better)
| Engine / Series | Value | Notes |
| :--- | :--- | :--- |
| TursoDB Plaintext (full-table decrypt scan) | 14 ms | Baseline (unencrypted) |
| TursoDB AEGIS-256 (full-table decrypt scan) | 20 ms | +42.9% vs Plaintext |
| TursoDB AES-256-GCM (full-table decrypt scan) | 33 ms | +135.7% vs Plaintext |

### Native Primary-Key Point Lookup p99 (2,000 verified queries · Prepared) (lower is better)
| Engine / Series | Value | Notes |
| :--- | :--- | :--- |
| TursoDB 0.8.4 Point Lookup p99 | 0.0017 ms | p50 0.0014ms |
| C SQLite 3.54.1 Point Lookup p99 | 0.0014 ms | p50 0.0012ms |
| Stoolap 0.5.1 Point Lookup p99 | 0.0008 ms | p50 0.0004ms |

### Key Takeaways
- 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.

## When to Choose TursoDB
- 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.

## When to Choose SQLite
- 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.

## Architecture 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.

## 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.
