DataHut-DuckHouse is a modern, modular, and multi-tenant analytics platform that combines DuckDB, Apache Iceberg, Arrow Flight, dbt, and Trino to build a hybrid, lightweight, and scalable data stack ready for SaaS.
๐ DataHut-DuckHouse
DataHut-DuckHouse is a lightweight, hybrid, and open-source analytics platform that combines the simplicity of DuckDB, the scalability of Iceberg, the speed of Arrow Flight, the orchestration power of Xorq, and the modularity of dbt to create a modern, local or cloud-ready data stack.
๐งฑ Architecture SaaS hybride
+------------------------+
| CSV / Local Files |
+-----------+------------+
|
v
+------------------------+
| Arrow Flight Client |
| (ingest_flight.py) |
+-----------+------------+
|
v
+--------------+---------------+
| Arrow Flight Server |
| (Xorq + app.py) |
| - hybrid backend: Iceberg + DuckDB
| - snapshots, synchronized views
+--------------+---------------+
|
+---------------+----------------+
| |
+--------+ +-------------+
| DuckDB | | Iceberg |
+--------+ +-------------+
| |
+--------+ +---------------+
| |
+-------------+ +-------------+
| dbt | | Trino |
+-------------+ +-------------+
| |
| v
| BI Tools (Metabase, Tableau)
|
v
SQL models per tenant
โจ Features
- ๐ Fast ingestion via Arrow Flight
- ๐ค Hybrid storage: local DuckDB & Iceberg (MinIO)
- ๐ง Orchestration with Xorq (Flight + multi-backend support)
- ๐ Auto-synchronization with Trino (catalogs)
- ๐ Declarative SQL transformations using dbt
- ๐ฆ Multi-tenancy: dynamic tenant creation/deletion
- โ๏ธ S3 integration via MinIO
โ๏ธ Requirements
๐ Installation
1. Clone the repository
git clone https://github.com/Geobatpo07/datahut-duckhouse.git
cd datahut-duckhouse
2. Install Python dependencies
poetry install
3. Launch the full environment
docker-compose up --build
4. Create a tenant
poetry run python scripts/createtenant.py --id tenantacme
5. Ingest data
Place a CSV file in ingestion/data/data.csv then run:
poetry run python scripts/ingest_flight.py
๐ Project Structure
datahut-duckhouse/
โโโ flight_server/ # Arrow Flight Server + HybridBackend
โ โโโ app/
โ โโโ app.py
โ โโโ app_xorq.py
โ โโโ xorq_config.py
โ โโโ utils.py
โ โโโ backends/hybrid_backend.py
โโโ ingestion/data/ # Source data
โโโ scripts/ # Ingestion, queries, tenant management
โ โโโ ingest_flight.py
โ โโโ query_duckdb.py
โ โโโ create_tenant.py
โ โโโ delete_tenant.py
โโโ transform/dbt_project/ # dbt models
โโโ config/ # Trino, dbt, tenants, users
โ โโโ trino/etc/
โ โโโ tenants/
โ โโโ users/users.yamlx
โโโ .env # Environment variables
โโโ docker-compose.yml
โโโ pyproject.toml
๐ง Using dbt with DuckDB
export DBTPROFILESDIR=transform/dbt_project/config
cd transform/dbt_project
poetry run dbt run
๐ Example Local Query
poetry run python scripts/query_duckdb.py
๐ Delete a Tenant
poetry run python scripts/deletetenant.py --id tenantacme
๐ BI Interface with Trino
Access Trino at http://localhost:8080 Use tenant_acme as the Trino catalog in Superset or Metabase.
๐ฃ๏ธ Roadmap
- โ Multi-tenant Iceberg + DuckDB
- โ Dynamic registration with Xorq + Trino
- ๐ Flask/React management interface
- ๐ User authentication + role management
- ๐ Integration with Metabase or Superset
- ๐ SaaS deployment on public cloud
๐ License
Project under MIT License.
โ๏ธ Author
Geovany Batista Polo LAGUERRE โ lgeobatpo98@gmail.com | Data Science & Analytics Engineer