TursoDB vs DuckDB
Row-oriented OLTP, MVCC writes, and cloud sync vs. vectorized columnar analytics over Parquet and S3.
Engineering Verdict
TursoDB and DuckDB are complementary rather than direct substitutes. Choose DuckDB for in-process analytical scans, aggregations, and direct querying over Parquet, Arrow, or S3 data lakes; choose TursoDB for transactional OLTP state, frequent point lookups/updates, concurrent writes, and local-to-cloud sync.
Both TursoDB and DuckDB run embedded inside your application process with zero server daemon, which leads developers to compare them. Under the hood, they optimize for opposite access patterns: TursoDB is a row-oriented transactional SQLite-compatible engine, whereas DuckDB is a C++ vectorized columnar OLAP engine.
Side-by-Side Technical Matrix
Verified Real-Hardware Benchmarks
VERIFIED RUNOLTP Single-Row Point Writes (Prepared · 5000 tx · bun 1.4.5)
Higher is better · ops/sOLAP GROUP BY Aggregation (100,000 rows · median · bun 1.4.5)
Lower is better · ms- With hoisted prepared statements on BOTH engines, TursoDB outperformed DuckDB by 2.15× on 5,000 single-row OLTP commits (2,519 vs 1,174 ops/s on Bun; 2,324 vs 1,191 ops/s on Node.js), while DuckDB columnar led by 8.7× on 100k-row OLAP GROUP BY (3.80 ms vs 33.17 ms, 5-run median).
- Hybrid zero-ETL architecture verified: after WAL checkpoint, DuckDB directly ATTACHed the TursoDB .db file (100,000 rows verified) and completed the OLAP aggregation in 20.24 ms median—1.64× faster than row-store scan without copying data.
bash benchmarks/run-suite.sh --only e6 --runtime all View full 8-scenario Real-Hardware Benchmarks Hub →
How to Choose
- Your app performs frequent point lookups, row updates, user sessions, or transactional writes (OLTP).
- You need local-to-cloud sync, embedded read replicas, or managed multi-tenant database orchestration.
- You are building AI agents or SaaS apps storing operational state and vector embeddings in one file.
- You want SQLite file-format compatibility with low memory overhead per open database.
- You need fast aggregations, window functions, and multi-million-row scans over wide analytical datasets.
- You want to query Parquet, CSV, Apache Arrow, Iceberg, or S3 buckets directly with zero ETL.
- You are building data-science pipelines, BI dashboards, or local ETL scripts in Python, R, or Node.
- Your workload is read-heavy or batch-append rather than high-frequency single-row mutations.
Architectural Deep Dive
Row-Oriented B-Trees vs. Vectorized Columnar Storage
TursoDB stores complete rows on B-tree pages so fetching or updating a single user record touches only a handful of kilobytes, keeping latency in the microsecond range. DuckDB compresses values column-by-column into row groups and processes thousands of values per CPU vector batch—delivering orders-of-magnitude faster GROUP BY and SUM queries while making tiny single-row updates expensive.
Using Both Together in One Architecture
Because both engines are MIT-licensed and run in-process, many teams pair them cleanly instead of forcing one to do both jobs. TursoDB handles operational application state, per-tenant writes, and cloud sync, while DuckDB attaches directly to exported snapshots or Parquet logs to run heavy analytical reporting.
Code Comparison
import { connect } from '@tursodatabase/database';
const db = await connect('./orders.db');
await db
.prepare('INSERT INTO orders (id, user_id, total_cents) VALUES (?, ?, ?)')
.run('ord_901', 'usr_42', 4900); import { DuckDBInstance } from '@duckdb/node-api';
const instance = await DuckDBInstance.create(':memory:');
const conn = await instance.connect();
const reader = await conn.runAndReadAll(
"SELECT region, SUM(revenue) FROM 's3://bucket/sales/*.parquet' GROUP BY region",
); Developer FAQ
Can DuckDB query SQLite or TursoDB files directly?
Yes. DuckDB ships a built-in SQLite scanner extension that can read standard SQLite-format .db files directly for ad-hoc analytical queries.
Why shouldn’t I use DuckDB for a standard CRUD web backend?
DuckDB’s columnar row-group format and single-process write model are optimized for bulk scans and batch loads, not thousands of tiny concurrent INSERT/UPDATE transactions or multi-device cloud sync.
Is TursoDB good for analytics over 100 GB Parquet files?
No. For multi-gigabyte analytical scans over Parquet or S3 object storage, DuckDB’s vectorized columnar engine is vastly faster and purpose-built for the task.
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
Native Rust speed, MVCC concurrency, and cloud sync vs. full PostgreSQL semantics compiled to WebAssembly.
Async Rust rewrite with concurrent MVCC writes and native cloud sync vs. the battle-tested C original.
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.