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
.sqlitefiles 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?
- You have a
.sqlitefile → SQLite (SQLite Browser). - You have CSV / Parquet / JSON and want analytics → DuckDB (SQL Playground).
- You want to prototype a Postgres-shaped app → PGlite in your own project.
Zro7