DuckDB WASM Demo
A full SQL database running inside your browser tab. Walk through a small analysis, then write your own queries.

SQL with Nothing to Install
A Real Database in a Browser Tab
DuckDB is an analytics database that runs in process. Its C++ code is compiled to WebAssembly, so typical database work happens directly in the browser.
A Small Analysis, Step by Step
Explore a dataset that records vehicle mileage and fuel prices. Each step runs more advanced SQL against it, up to window functions, to show what the full engine can do.
Bring Your Own SQL
After the walkthrough, the database stays live. Pick a sample query or write your own against the sample data. Nothing leaves your machine.
At a Glance
What Happens When the Page Loads
- Page LoadsHTML and JS from NGINX
- Engine DownloadDuckDB WASM via jsDelivr
- Web WorkerStarted from a Blob URL
- CSV to TableOne DuckDB command
- QueriesResults in the page
Built with
Key takeawayBrowsers won't start a Web Worker from a cross-origin URL, even with CORS headers. A
Blobthat callsimportScripts()on the CDN script, passed toURL.createObjectURL(), gives a same-origin URL that works.
Build Notes
Challenges, learnings, and what's next
Challenges
- Initializing the DuckDB engine in the browser adds noticeable load time to pages.
- DuckDB and WASM are fairly new tools that many developers haven't used yet.
Learnings
- WASM is more approachable than expected, especially when JavaScript wrappers and WASM binaries are available from a CDN.
- Web Workers cannot be created using cross-origin URLs. The
Worker()constructor strictly enforces a same-origin policy, regardless of CORS headers. - Window functions are a powerful part of the SQL standard, and DuckDB supports them well for analytical queries.
Next
- Explore the practical dataset size limits of this architecture.
- Compare WASM query performance against native query performance.
- Use Parquet files hosted on a remote server, allowing DuckDB to fetch only the relevant row groups via HTTP range requests.
More Apps

Cooking Recipes
Recipes without the ads, life stories, or popups. Built for cooking from a phone.

This Website
My developer portfolio and blog. Built with the Astro framework and deployed to a self-managed Hetzner VPS. The entry point to all my web content.

Softball Pulp
Auto-generate a winning softball lineup using linear programming and PuLP.


