# TursoDB vs Stoolap

> Stoolap is an impressive pure Rust embedded HTAP engine packing full MVCC (Read Committed & Snapshot Isolation), `AS OF` time-travel queries, rich index types (B-Tree, Hash, Bitmap, HNSW), and Rayon-parallelized analytics into a single binary. TursoDB is the stronger choice when you need SQLite file/dialect compatibility, multi-language SDKs, and built-in local-to-cloud sync.
> Canonical HTML: https://tursodb.cn/compare/turso-vs-stoolap/
> Language: en
> Stoolap Official Site: https://stoolap.io/

## Overview
Rewritten in pure Rust from an earlier Go prototype, Stoolap targets hybrid transactional and analytical processing (HTAP) inside one embedded engine. Both Stoolap and TursoDB bring Rust memory safety and MVCC concurrent writes to embedded SQL, but they diverge on SQLite compatibility, analytical parallelism, and cloud synchronization.

## Comparison Matrix
| Dimension | TursoDB | Stoolap |
| :--- | :--- | :--- |
| Core Engine | SQLite-compatible Rust B-tree — Pure Rust engine with non-blocking async io_uring I/O | Pure Rust HTAP engine — Rewritten from Go with Rayon-parallelized analytical query execution |
| Deployment Model | Embedded + cloud sync — In-process library with optional sync and managed Turso Cloud | Local in-process library — File or in-memory embedded engine with no cloud sync service |
| Concurrency & Writes | Optimistic MVCC writes — BEGIN CONCURRENT writers paired with non-blocking async I/O | Full MVCC + OCC — Supports Read Committed, Snapshot Isolation, and optimistic concurrent writes |
| Sync & Edge Replication | Native pull/push sync — Built-in bidirectional sync and embedded read replicas | Local-only storage engine — No built-in remote replication or edge sync protocol |
| Multi-Tenant Isolation | Local + cloud per-tenant — Isolated files locally scaling to millions of synced cloud DBs | Local file isolation — Separate files per tenant; cloud orchestration is application-managed |
| Vector & AI Search | Disk-friendly DiskANN vectors — Native vector columns tuned for low memory across many DBs | Built-in HNSW indexes — In-memory HNSW vectors alongside B-Tree, Hash, and Bitmap indexes |
| SQL Dialect & Ecosystem | SQLite polyglot ecosystem — Standard file format with Rust, JS/TS, Python, Go, C, and WASM | Time-travel HTAP SQL — Native `AS OF` snapshot queries in a Rust-first ecosystem |
| License | MIT permissive license — Open-source core with no copyleft restrictions | Apache-2.0 license — Permissive open-source license with explicit patent grant |

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

### Native Batch Insert Throughput (50,000 rows · Prepared · Rust --release) (higher is better)
| Engine / Series | Value | Notes |
| :--- | :--- | :--- |
| TursoDB 0.8.4 (Rust SQLite Format) | 696035.3 rows/s | WAL + FULL · prepared |
| C SQLite 3.54.1 (rusqlite bundled) | 2764591.8 rows/s | WAL + FULL · prepared |
| Stoolap 0.5.1 (Rust HTAP) | 492556.1 rows/s | file:// default sync (normal) · prepared |

### 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
- 3-way native Rust --release benchmark (hoisted prepared statements, latest stable crates): TursoDB 0.8.4 (WAL+FULL) beat Stoolap 0.5.1 (default normal sync) by 1.41× on 50k batch inserts (696,035 vs 492,556 rows/s), while C SQLite 3.54.1 (rusqlite bundled, WAL+FULL) led at 2,764,592 rows/s.
- All three engines delivered sub-2-microsecond verified PK point lookups at p99: Stoolap 0.5.1 led at 0.0008 ms (0.8 µs, PkGet index verified via EXPLAIN), C SQLite 3.54.1 at 0.0014 ms, and TursoDB 0.8.4 at 0.0017 ms (1.7 µs).
- SQLite ecosystem compatibility verified: standard sqlite3 3.45.1 CLI opened TursoDB 0.8.4’s .db file directly and passed PRAGMA integrity_check (ok | 50000 rows), whereas Stoolap uses a custom storage format.

## When to Choose TursoDB
- You need SQLite file-format and SQL dialect compatibility with mainstream ORMs and developer tooling.
- You want built-in local-to-cloud sync, embedded replicas, and an optional managed cloud control plane.
- Your team works in TypeScript, Python, Go, or WASM—not just Rust—and needs official idiomatic SDKs.
- You prefer disk-oriented DiskANN vector search to keep RAM usage predictable across many small databases.

## When to Choose Stoolap
- You are building a Rust application that needs hybrid OLTP + multi-core OLAP execution (via Rayon) in a single embedded engine.
- You want native `AS OF` time-travel queries to inspect historical snapshots directly in SQL.
- Your queries benefit from specialized index structures—Hash, Bitmap, and in-memory HNSW vector indexes—beyond standard B-trees.
- You want explicit Read Committed and Snapshot Isolation MVCC semantics under an Apache-2.0 license.

## Architecture Deep Dive
### SQLite Compatibility vs. Clean-Sheet HTAP Design
TursoDB commits to SQLite’s binary file format and SQL grammar, which unlocks immediate compatibility with existing schemas and tooling while constraining internal storage layouts. Stoolap starts from a clean sheet in Rust—allowing specialized Bitmap, Hash, and HNSW indexes, native `AS OF` temporal queries, and Rayon work-stealing parallelism for analytical scans within one embedded database.

### Local HTAP Power vs. Distributed Sync Infrastructure
Stoolap focuses entirely on maximizing single-node embedded capabilities—combining transactional OCC writes with parallel analytical execution inside your process. TursoDB invests heavily in what happens across nodes: async I/O, local-to-cloud synchronization, embedded replicas, and multi-tenant cloud orchestration.

## FAQ
### How do Stoolap’s HNSW indexes compare to TursoDB’s DiskANN vectors?
HNSW excels at low-latency in-memory vector search on a single node, while DiskANN is designed to stay memory-efficient on disk—especially valuable when hosting many concurrent per-tenant databases.

### What are Stoolap’s `AS OF` time-travel queries useful for?
Because Stoolap maintains MVCC row versions, `AS OF` lets you query a table as it existed at a prior timestamp or transaction snapshot—useful for auditing, debugging, and point-in-time analytics without restoring backups.

### Is Stoolap compatible with SQLite files or drivers?
No. Stoolap uses its own storage format and SQL engine rather than SQLite’s file format, whereas TursoDB maintains SQLite compatibility.
