Database7 min

SQLite vs DuckDB vs PostgreSQL in the Browser: A 2026 Benchmark

SQLite, DuckDB, and PostgreSQL all run in the browser via WASM. Which one should you use? A head-to-head on load time, query speed, and file support.

Every engine referenced here runs client-side via WebAssembly in Zro7 tools. No data is uploaded.

All three of the major relational engines now ship as WebAssembly builds: sql.js (SQLite), DuckDB-WASM, and PGlite (PostgreSQL). Zro7 uses SQLite for SQLite Browser and DuckDB for the SQL Playground, Big CSV Viewer, and BI Dashboard. Here's how they actually compare in 2026.

SQLite (sql.js)

  • Strength: opens existing .sqlite files perfectly. OLTP-shaped (row-oriented, transactional).
  • Bundle: ~1.2 MB WASM.
  • Best for: inspecting an existing SQLite DB (app data exports, Firefox history, iMessage backups).

DuckDB-WASM

  • Strength: columnar + vectorized. Analytical SQL (GROUP BY, joins, window functions) is 10–100× faster than SQLite on large scans.
  • Bundle: ~5 MB core + 3 MB extensions loaded on demand.
  • Direct file registration: query a CSV or Parquet file without an import step.
  • Best for: analytics, CSV/Parquet exploration, BI dashboards, log analysis.

PGlite (PostgreSQL)

  • Strength: real Postgres semantics — arrays, JSONB, extensions, triggers.
  • Bundle: ~3 MB, tighter than expected because unused Postgres subsystems are stripped.
  • Best for: prototyping a Postgres-shaped app without provisioning a server; learning PL/pgSQL locally.

2026 head-to-head numbers

Measured on a 500 MB TPC-H lineitem CSV, MacBook M2, Chrome 128:

  • Load CSV → query-ready: DuckDB 1.2s (streamed), SQLite 41s (INSERT loop), PGlite 68s (COPY).
  • GROUP BY 8 columns: DuckDB 0.4s, SQLite 22s, PGlite 26s.
  • Window fn (running total): DuckDB 0.8s, SQLite 34s, PGlite 30s.
  • Startup cold cache: SQLite 0.2s, PGlite 0.4s, DuckDB 0.9s (first query only).

Which should you pick?

  1. You have a .sqlite file → SQLite (SQLite Browser).
  2. You have CSV / Parquet / JSON and want analytics → DuckDB (SQL Playground).
  3. You want to prototype a Postgres-shaped app → PGlite in your own project.

Frequently asked questions

Can I use all three at once?

Yes — each is a separate WASM module. Zro7 loads DuckDB and SQLite on their respective tool routes.

Which is smallest?

sql.js has the smallest core (~1.2 MB), but DuckDB catches up in effective size when you factor extensions.

Do any support writes back to file?

SQLite via sql.js can export the whole DB as a .sqlite blob. DuckDB writes CSV/Parquet with COPY. PGlite persists to IndexedDB or OPFS.

Is DuckDB really 50× faster than SQLite?

For scan-heavy analytical queries on 100 MB+ tables, yes — because it's columnar. For single-row OLTP lookups, SQLite is competitive or faster.

Any upload?

None. All three engines run entirely in your browser.

Related posts

← Back to blog