A performance testing suite comparing DuckDB and SQLite for analytical queries on 10 million order records.
node generate-data.jsThis creates CSV files with:
- 100,000 customers
- 10,000 products
- 10,000,000 orders
node init-databases.jsThis loads the data into both SQLite and DuckDB databases.
node server.jsThe dashboard will be available at http://localhost:3023
The benchmark runs 6 complex analytical queries with multiple joins and aggregations:
- Total Revenue by Country - Aggregates orders by customer country
- Top Products by Category - Multi-level grouping with product data
- Monthly Sales Trends - Time-based aggregation with distinct counts
- Customer Lifetime Value - Subquery with customer-level metrics
- Category Performance Analysis - Comprehensive category analytics
- Complex Multi-Join Aggregation - Heavy join with multiple GROUP BY and HAVING clauses
Based on the hypothesis, DuckDB should show:
- Query latency reduction from seconds to milliseconds
- Significant speedup (10x-100x) for analytical queries
- Sub-10ms dashboard load times vs 8+ seconds for SQLite
GET /api/benchmark?db=sqlite- Run SQLite benchmarksGET /api/benchmark?db=duckdb- Run DuckDB benchmarksGET /api/stats- Get database statistics
- express - Web server
- duckdb - DuckDB database driver
- better-sqlite3 - SQLite database driver