Geobatpo07
datahut-duckhouse
Python

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.

Last updated Nov 1, 2025
12
Stars
1
Forks
1
Issues
0
Stars/day
Attention Score
1
Language breakdown
Python 93.5%
Makefile 2.5%
TypeScript 1.7%
Dockerfile 1.0%
CSS 0.9%
JavaScript 0.3%
โ–ธ Files click to expand
README

๐Ÿ  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

๐Ÿ”— More in this category

ยฉ 2026 GitRepoTrend ยท Geobatpo07/datahut-duckhouse ยท Updated daily from GitHub