Building an Interactive Data Engineering Blog with DuckDB-WASM
Building an Interactive Data Engineering Blog with DuckDB-WASM
Welcome to my new interactive blog. This blog doesn't just show code—it runs it. Using the exact same architecture that powers my /analytics dashboard, we can execute highly performant OLAP queries entirely in the browser using DuckDB-WASM via HTTP range requests on remote Parquet files.
This is what I call "Evidence BI-as-Code".
The ATP Tennis Dataset
To demonstrate this, I am querying a reproducible ATP Tennis snapshot. A separate Python ETL pipeline preserves the source CSV files in raw S3, applies typed transformations with Polars LazyFrames, and writes compressed Gold .parquet files back to S3. Airflow and Databricks can be added later without changing the browser-facing tables.
Because DuckDB-WASM is running locally on your machine right now, you can execute the SQL below, and the engine will fetch only the required .parquet byte ranges through CloudFront. The S3 origin remains private behind Origin Access Control, while Vercel and the browser need no AWS credentials.
1. Top Players by Match Wins (2000-2024)
Let's run a query to find the most successful players over the last two decades. Notice how fast it executes in the browser without any backend server processing the query.
Most Wins (2000-2024)
SELECT
winner_name as Player,
COUNT(*) as Wins,
MAX(tourney_date) as Last_Win_Date
FROM atp_matches
WHERE tourney_date >= 20000101
GROUP BY winner_name
ORDER BY Wins DESC
LIMIT 10;
2. The Rise of the Aces
We can also perform complex aggregations. Here, we analyze the average number of aces hit by the winner across different surface types (Grass, Clay, Hard, Carpet).
Average Aces by Surface Type
SELECT
surface as Surface,
ROUND(AVG(w_ace), 2) as Avg_Aces,
COUNT(*) as Total_Matches
FROM atp_matches
WHERE w_ace IS NOT NULL AND surface IS NOT NULL
GROUP BY surface
ORDER BY Avg_Aces DESC;
Why This Architecture Matters (2026 Strategy)
The traditional modern data stack requires a cloud data warehouse (Snowflake/BigQuery) directly queried by an BI tool (Tableau/Looker). This involves high compute costs and network latency.
By moving the final aggregation layer directly into the client's browser with WebAssembly:
- Zero Compute Costs: Your users' laptops execute the SQL.
- Sub-second Latency: DuckDB operates on highly optimized memory vectors.
- Decentralized Data Applications: You can build entire data products served statically from edge networks (like Vercel).
Stay tuned for more interactive MotherDuck Dives, Kafka streaming walkthroughs, and Airflow orchestration strategies!