[ case study · the lab ]
DuckDB 2.0 runs inside the visitor's browser and queries 250,000 rows of synthetic AI-usage data. No server, no API, no database to host — and every number on the page shows the SQL that produced it.
November 2026 · synthetic data throughout
A firm running its own language models on its own hardware still wants the ordinary management answers: who is using them, for what, how fast, and what it costs. The catch is that the usage log is the single file they are least willing to hand to someone else's cloud.
That makes the thing hard to demonstrate. The usual analytics demo needs a warehouse, credentials and a monthly bill, so it can't just be published on a website for a stranger to open. I wanted a version with nothing behind it — one a visitor could open, poke at, and check for themselves.
meta column, whose shape varies by use case. It is capped at 1,000 rows and ten seconds.The data has things in it on purpose, so there is something to find: a week in March where a GPU node degrades and p95 latency triples, one model whose error rate climbs through June after a bad upgrade, and thumbs-up rates that fall as responses get slower.
The spec came first. Before any code I wrote out the scenario, the tables and their columns, the patterns the data had to contain, the panels, the performance budget and the constraints — no backend, no paid service, no analytics tracker. Claude Code built from that spec; the parts I kept for myself were the spec, the version pinning and the verification.
The generator is deterministic. A Python script with a fixed seed writes the four Parquet files, and two runs produce byte-identical output. The weekday peaks, the holiday dips, the adoption ramp and the incident are all planted by that script, so anyone can regenerate the exact dataset the dashboard is showing.
The version check was not a formality. DuckDB 2.0 shipped a new storage format, and at build time the latest tag of the browser build still embedded a pre-2.0 engine. Pinning "the newest one" would have quietly shipped the wrong core. The build I use is pinned exactly, and because it identifies itself as a development build, DuckDB's extension autoloader looks for a folder that does not exist — so the Parquet and JSON readers are loaded by hand from a fixed, official URL instead.
Then the database locks itself. Once the data is loaded the page runs SET enable_external_access = false and SET lock_configuration = true. After that nothing on the page — the SQL box included — can fetch or load anything. "Nothing leaves your browser" is something the engine enforces, not a promise in a footer.
The single-threaded WebAssembly bundle is used deliberately, so the page needs no special cross-origin isolation headers and will drop onto any static host. Charts are Apache ECharts. There is no build step: the deliverable is plain HTML, CSS and ES modules.
The browser is a far better analytics engine than its reputation suggests — a quarter of a million rows is nothing, and filtering the whole year re-runs real SQL fast enough that it feels local, because it is. What actually costs the visitor is the download, not the compute: the WebAssembly engine and the Parquet files dwarf every query on the page. That flips the usual optimisation instinct. I spent my time on what loads first and in what order, and almost none on making the SQL faster.
The other lesson was duller and more useful. The one decision that could have invalidated the whole exercise — which DuckDB the browser build actually contains — was a thing no amount of careful coding would have caught, only checking. Reproducibility is mostly made of boring verifications like that one.
A short plan back within 2 business days: problem, approach, deliverables, price, timeline.