DuckDB for BI: Superset and Metabase on a DuckDB file
DuckDB is a good engine for dashboards: fast on aggregations, free, and it reads Parquet where it lies. It is also a library, not a server, and that shapes everything about running a BI tool on it. We put Apache Superset 6.1.0 and Metabase 0.63.17 on the same DuckDB file and recorded what worked, what did not, and where one file behind a BI server stops being enough.
The test database, and the version trap
# pip install "duckdb==1.5.6"
import duckdb
con = duckdb.connect("shop.duckdb")
con.sql("""
CREATE TABLE orders AS
SELECT range AS order_id,
(range // 330) % 1000 AS customer_id,
((range * 37) % 20000 / 100.0)::DECIMAL(10,2) AS amount,
DATE '2026-01-01' + (range % 330)::INT AS order_date
FROM range(1_000_000)
""")
con.sql("""
CREATE TABLE customers AS
SELECT range AS id, 'Customer ' || range AS name,
CASE WHEN range % 10 = 0 THEN 'enterprise'
WHEN range % 10 < 4 THEN 'mid-market'
ELSE 'smb' END AS segment
FROM range(1000)
""")
con.sql("COPY orders TO 'orders.parquet' (FORMAT parquet)")
con.close()The version pin matters. Both BI tools ran DuckDB 1.5.6 inside them, and a file written by DuckDB 2.0.1 does not open there: Trying to read a database file with version number 69, but we can only read versions between 64 and 68. The other direction works, so build the file with the oldest DuckDB that will read it. One million orders and 1,000 customers make a 4.7 MB file.
The same question went to both tools, revenue by customer segment since 1 November:
SELECT c.segment, count(*) AS orders, sum(o.amount) AS revenue FROM orders o JOIN customers c ON c.id = o.customer_id WHERE o.order_date >= DATE '2026-11-01' GROUP BY 1 ORDER BY 3 DESC;
The right answer is 47,268 orders and 4,722,995.34 for SMB, 23,634 and 2,365,096.37 for mid-market, 7,878 and 789,291.19 for enterprise. Both tools returned it.
Superset on a DuckDB file
# Superset's own pinned versions, then the extra that brings the driver curl -LO https://raw.githubusercontent.com/apache/superset/6.1.0/requirements/base.txt grep -v '^-e' base.txt > constraints.txt pip install "apache-superset[duckdb]==6.1.0" rich -c constraints.txt # Then add a database with this SQLAlchemy URI (an absolute path: four slashes) duckdb:////data/shop.duckdb
- The extra installs duckdb-engine 0.17.0 and DuckDB 1.5.6 next to SQLAlchemy 1.4.54. Superset 6.1 pins SQLAlchemy below 2, which rules out the newer duckdb-sqlalchemy driver here. The two drivers are compared in DuckDB with SQLAlchemy.
- Install against the constraints file. Without it, the installer chose newer versions of Superset's dependencies and superset db upgrade stopped with a TypeError in its cache setup. We ran this on Python 3.11, and added rich because the superset command would not start without it.
- What worked: the connection test, the test query in SQL Lab, and the schema browser, which listed both tables and their columns. A query can also read a Parquet file by path, FROM '/data/orders.parquet', with no table defined.
- Superset refuses DDL and DML unless you turn on Allow DML for the database. To open the file read-only as well, put {"connect_args": {"read_only": true}} in the database's engine parameters.
Metabase on a DuckDB file
Metabase does not use SQLAlchemy. It loads each database driver as a plugin, and the DuckDB one is a community driver maintained by MotherDuck. Its README says it does not run in Metabase's standard Docker image, which is built on Alpine, and its maintainers publish an image where it does.
docker run -d --name metabase -p 3000:3000 \ -v "$PWD":/data \ ghcr.io/motherduckdb/metabase-duckdb:latest # Then: Add a database -> DuckDB # Database file: /data/shop.duckdb # Establish a read-only connection: on
- That image gave us Metabase 0.63.17 with DuckDB 1.5.6.
- What worked: Metabase's sync found both tables and typed their columns, the test query returned the right rows as native SQL, and a query-builder question (count and sum of amount by month) ran too. Metabase generated DATE_TRUNC('month', ...) for it and got 11 rows back.
- Parquet by path works here as well: SELECT count(*) FROM '/data/orders.parquet' WHERE order_date >= DATE '2026-11-01' returned 78,780.
- Point it at a file, not at :memory:. The driver's documentation notes that Metabase opens several connections and each in-memory connection is a separate, empty database.
What one file behind a BI server costs
- Loads and dashboards exclude each other. While another process had the file open for writing, a Superset query failed with IO Error: Could not set lock on file ... Conflicting lock is held, and it worked again when the writer exited. It is symmetric: while a reader holds the file, the writer cannot open it. Read-only connections can share the file; a writer cannot join them.
- So a refresh needs a plan. Write a new file and swap it in, or stop the dashboards for the length of the load.
- The file lives on the BI server. It has to be on that machine's disk or in the container's volume, and so does anything else the queries read.
- The BI tool's DuckDB version decides what it can open. See the version trap above; an upgrade of your loader can break the dashboards.
- Everything else has to be loaded first. Data in PostgreSQL, a warehouse or a bucket reaches the dashboard only after a job copies it into the file, with that job's credentials and schedule.
- Access control is the BI tool's alone. Anyone who can run SQL against the database entry can read every table in the file.
None of this is a flaw in DuckDB. It is what an in-process database means once the process is a shared server. For one analyst's dashboards over a nightly export, a file is the cheapest setup there is. It gets harder with several writers, fresh data, or sources that should not be copied.
Superset on Thunderduck: one URL, every catalog
With Thunderduck the BI server holds no data file at all. Superset connects through thunderduck-sqlalchemy, a SQLAlchemy dialect on PyPI, and queries run on Thunderduck against the catalogs you have connected. Because it is a real SQLAlchemy dialect rather than a notebook helper, anything that connects to a database through SQLAlchemy can use it — and the most useful example of that is Apache Superset. Installing the package into your Superset image is the entire integration: it registers a Superset database engine spec through an entry point, so there is no configuration file to edit.
# In your Superset image (or superset-worker), one line: pip install thunderduck-sqlalchemy # Then in the UI: # Settings -> Database Connections -> + Database -> Other # SQLAlchemy URI: thunderduck://:[email protected]/
From there Superset behaves exactly as it does on any warehouse. SQL Lab browses your catalogs and runs ad-hoc SQL; save a query as a virtual dataset and build charts on it; time grains, LIMIT handling and column types are correct because the engine spec inherits DuckDB's — which is the SQL dialect Thunderduck actually executes. Superset's stop button is wired to a real cancel endpoint, so killing a slow chart kills the job behind it.
What that combination is worth: BI on open files in your own storage, with no warehouse to load them into first. Analysts get a self-service tool they already know, ad-hoc exploration is charged in query-seconds instead of idle compute, and every chart refresh appears in Thunderduck's Monitoring page with its plan and cost — so the answer to which dashboard costs us the most is a query, not a guess.
Metabase and Thunderduck
There is no Metabase driver for Thunderduck today. Because Metabase loads JVM plugins, the SQLAlchemy dialect does not help it, and a JDBC jar on its own is not enough either: Metabase needs a driver plugin written for it. Thunderduck's JDBC driver serves DataGrip, DBeaver and other tools that take a driver jar. If Metabase is your BI tool, tell us; the JDBC driver is the base such a plugin would be built on.
Which setup, when
| Situation | Setup |
|---|---|
| One person, a nightly export, dashboards that can be down during the load | Superset or Metabase on a DuckDB file |
| Parquet files on the BI server and nothing else | Either tool, querying the files by path |
| Data in several databases, a warehouse and a bucket | Superset on Thunderduck |
| Several teams, with different access to the same tables | Superset on Thunderduck |
| Metabase and data that cannot be copied into a file | Not covered by a DuckDB file or by Thunderduck today |