Get confident with DuckDB WASM — browser-side SQL analytics, remote Parquet queries, and Arrow result formats.
0 / 5 completed
1 / 5
At standup, a frontend developer asks what DuckDB WASM is. What is the correct answer?
DuckDB WASM is a true WebAssembly port of the full DuckDB engine. It runs in the browser without any server, supports the complete DuckDB SQL dialect, and can query local files (via virtual filesystem) or remote Parquet/CSV/JSON files directly. It is also available for Node.js and Deno, using the same compiled WASM binary.
2 / 5
In a PR review, a colleague queries a remote Parquet file directly in DuckDB WASM. What is the correct explanation of how this works?
DuckDB WASM bundles the httpfs extension and uses the browser's fetch API with HTTP range requests to read remote Parquet files lazily. It first reads the Parquet footer to discover row group metadata, then fetches only the row groups and columns needed to satisfy the query — making it efficient even for large remote files.
3 / 5
An incident involves a slow query on a large in-memory dataset loaded into DuckDB WASM. What is the most likely cause and correct explanation?
DuckDB WASM uses a fully columnar, vectorised execution engine — the same as server-side DuckDB. Aggregations and column-filtered queries are very fast. Slowness on large datasets is typically caused by reading entire files into memory rather than exploiting Parquet's predicate pushdown and column projection, which can be fixed by pushing filters into the SQL query.
4 / 5
In a design review, the team discusses returning query results as Arrow IPC format from DuckDB WASM. What is correct?
conn.query(sql) in DuckDB WASM returns an Apache Arrow Table as Arrow IPC record batches. This is a zero-copy columnar format — result data stays in the WASM memory buffer and is accessed via the Arrow JS API without serialisation overhead. Visualisation libraries like Observable Plot, Vega, and Apache ECharts can consume Arrow Tables directly.
5 / 5
In a code review, a developer needs to load a local file from a browser <input> into DuckDB WASM. What is the correct approach?
To load a local file from a browser <input type="file">, read it as a Uint8Array (e.g. using FileReader or arrayBuffer()) then call db.registerFileBuffer('filename.parquet', uint8Array). This registers the buffer in DuckDB WASM's virtual filesystem under the given name, which you can then reference in SQL as SELECT * FROM 'filename.parquet'.