# ahadmammad/ing-lakehouse architecture

> Architecture diagram of the GitHub repository ahadmammad/ing-lakehouse, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-05-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ahadmammad/ing-lakehouse
- Repository: https://github.com/ahadmammad/ing-lakehouse

## Overview

1. **Repository shape and boundary**
   - This repo is a **service-per-directory lakehouse platform** assembled with Docker Compose.
   - The top-level boundary is the **shared Docker network `lakehouse-net`**, which all runtime services use to talk to each other.
   - Each service owns its own compose file, config, and sometimes Dockerfile; the root `docker-compose.yml` acts as the composition layer.

2. **Core storage plane: RustFS**
   - **RustFS** is the object-storage foundation and is treated as the lakehouse data plane.
   - It is deployed as a **4-node distributed cluster** with an **nginx load balancer** in front of both the S3 API and the web console.
   - Host ports exposed in the repo show the main external entry points: **9000 for S3** and **9001 for the console**.
   - The docs indicate support for **erasure coding**, which is important to the storage architecture and resilience model.

3. **Metadata and table control plane: Nessie**
   - **Nessie** is the **Iceberg REST catalog** and versioning layer.
   - It sits between compute engines and object storage, managing table metadata, snapshots, branches/tags, and time-travel semantics.
   - It is exposed on **19120** and is configured separately under `services/nessie/config`.
   - In the architecture diagram, Nessie is the metadata authority for all Iceberg table operations.

4. **Table format layer: Apache Iceberg**
   - Iceberg is the table format used across the repo for **ACID semantics, schema evolution, partition evolution, and snapshot/history management**.
   - The notebooks are organized around Iceberg lifecycle topics, which suggests the platform’s main workflow is: ingest data, write Iceberg tables, evolve them, inspect metadata, and manage versions.
   - Iceberg is not a service itself here, but a **cross-cutting storage/table abstraction** used by Jupyter, ETL jobs, and likely future engines.

5. **Orchestration plane: Airflow**
   - **Airflow 3.2.1** is the workflow orchestrator and is explicitly configured with **CeleryExecutor** and **2 workers**.
   - The DAGs include:
     - `crypto_etl.py`
     - `weather_etl.py`
     - `lakehouse_smoke.py`
   - Airflow exposes the UI/API on **8082** and is the main scheduler for recurring ingestion and validation workflows.
   - This is the control-plane entry point for automation, retries, and dependency management.

6. **Custom ETL application**
   - `services/etl-app` is a separate Python package that holds the actual domain ETL logic.
   - It is organized by **domain** (`crypto`, `weather`) and by **data tier** (`bronze`, `silver`, `gold`), which maps cleanly onto a medallion-style flow.
   - The `sources/*` modules include client and schema code, so external APIs are likely queried there before transformation and loading.
   - Airflow DAGs likely invoke these jobs rather than embedding business logic directly in DAG definitions.

7. **Likely data flow through the lakehouse**
   - The repo’s main pipeline is:
     **external sources → ETL app sources/bronze jobs → Iceberg tables in RustFS via Nessie → silver/gold refinement jobs → analysis/query tools**
   - Bronze represents raw or minimally processed ingestion.
   - Silver and gold represent progressively curated/aggregated outputs.
   - Nessie provides table metadata/versioning while RustFS stores the actual Iceberg data and metadata files.

8. **Interactive compute and authoring**
   - **JupyterLab** is the interactive environment, exposed on **8888**.
   - The notebook set is strongly aligned to hands-on Iceberg workflows: catalog setup, write/read with Polars, schema evolution, partition evolution, row mutations, metadata inspection, branches/tags, snapshot management, compaction, and raw file inspection.
   - This suggests Jupyter is the primary **exploration and learning surface**, while Airflow/ETL app are the productionized paths.

9. **Query engines and BI surfaces**
   - **Trino** is configured with a Nessie catalog, indicating SQL query access over the Iceberg lakehouse.
   - **Spark** is included as a planned or adjunct distributed engine, with notebooks for maintenance/compaction support.
   - **Hue** and **CloudBeaver** are present as additional user-facing data access tools, likely for SQL browsing or administration, though they are not as central as Jupyter/Airflow.

10. **Platform operations and deployment**
   - The repo is operationalized with **Makefile targets** such as `up`, `down`, `status`, `logs`, `console`, and `clean`.
   - `.env` holds the shared deployment variables, including RustFS credentials and host ports.
   - There are separate compose variants for **singlenode**, **distributed**, and **SSL/local** scenarios, indicating the deployment architecture is intentionally environment-specific.

11. **Supporting scripts and utilities**
   - `scripts/setup-certs.sh` and the SSL compose files indicate the repo supports local TLS-enabled setups.
   - `scripts/find-free-ports.py` helps avoid local port collisions.
   - `scripts/reset_events_table.py` suggests repeatable demo/reset workflows for the ETL side.
   - `scripts/_gen_notebooks.py` implies the notebooks are generated or kept in sync from a source template/process.

12. **Documentation and conceptual boundaries**
   - The `docs/` tree is split by subsystem: Airflow, Iceberg, Nessie, and RustFS.
   - That structure mirrors the real architecture boundaries: orchestration, table format, metadata/versioning, and storage.
   - The docs are part of the platform design, not just auxiliary material; they define how the pieces are meant to interact.

13. **How to draw the architecture**
   - A useful diagram would show:
     - **Clients/users** at the top: Jupyter, Airflow UI, SQL tools
     - **Orchestration/control** in the middle: Airflow, Nessie, Trino/Spark
     - **Storage** at the bottom: RustFS cluster behind nginx
     - **ETL app** as a Python processing service connected to Airflow and external APIs
   - The key coupling is not direct service-to-service data exchange, but **all compute engines reading/writing Iceberg through Nessie while persisting files in RustFS**.

Main entry points: [`docker-compose.yml`](https://github.com/ahadmammad/ing-lakehouse/blob/main/docker-compose.yml) (Root Compose), [`services/nessie`](https://github.com/ahadmammad/ing-lakehouse/tree/main/services/nessie) (Nessie), [`services/rustfs`](https://github.com/ahadmammad/ing-lakehouse/tree/main/services/rustfs) (RustFS), [`services/airflow`](https://github.com/ahadmammad/ing-lakehouse/tree/main/services/airflow) (Airflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ops["Deployment"]
  node_root_compose["Root Compose<br/>composition<br/>[docker-compose.yml]"]
  node_shared_net{{"Lakehouse Net<br/>network"}}
  node_env_file["Env Vars<br/>deployment config<br/>[.env]"]
  node_makefile["Make Targets<br/>ops entrypoint"]
end

subgraph group_orchestration["Orchestration"]
  node_airflow["Airflow<br/>scheduler"]
  node_airflow_dags["DAGs<br/>workflow defs"]
  node_airflow_workers["Celery Workers<br/>execution"]
end

subgraph group_storage["Data Plane"]
  node_nessie[("Nessie<br/>iceberg catalog")]
  node_iceberg["Iceberg<br/>table format"]
  node_rustfs[("RustFS<br/>object storage")]
  node_rustfs_lb["Nginx LB<br/>reverse proxy<br/>[nginx.conf]"]
end

subgraph group_access["Access"]
  node_jupyter["JupyterLab<br/>notebook runtime"]
  node_trino["Trino<br/>sql engine"]
  node_spark["Spark<br/>compute engine"]
  node_hue["Hue<br/>sql ui"]
  node_cloudbeaver["CloudBeaver<br/>sql ui"]
end

subgraph group_etl["ETL App"]
  node_etl_app["ETL App<br/>python package"]
  node_etl_sources["Sources<br/>connectors"]
  node_etl_jobs["Medallion Jobs<br/>transforms"]
end

node_root_compose -->|"deploys"| node_airflow
node_root_compose -->|"deploys"| node_nessie
node_root_compose -->|"deploys"| node_rustfs
node_root_compose -->|"deploys"| node_trino
node_root_compose -->|"deploys"| node_jupyter
node_root_compose -->|"deploys"| node_spark
node_root_compose -->|"deploys"| node_hue
node_root_compose -->|"deploys"| node_cloudbeaver
node_airflow -->|"runs"| node_airflow_dags
node_airflow -->|"executes on"| node_airflow_workers
node_airflow_dags -->|"invokes"| node_etl_app
node_etl_app -->|"ingests from"| node_etl_sources
node_etl_app -->|"implements"| node_etl_jobs
node_etl_jobs -->|"writes via"| node_nessie
node_jupyter -->|"reads/writes"| node_nessie
node_jupyter -->|"explores"| node_iceberg
node_trino -->|"catalog"| node_nessie
node_spark -->|"catalog"| node_nessie
node_nessie -->|"stores metadata in"| node_rustfs
node_iceberg -->|"data files"| node_rustfs
node_rustfs -->|"fronted by"| node_rustfs_lb
node_airflow -->|"uses"| node_shared_net
node_nessie -->|"uses"| node_shared_net
node_rustfs -->|"uses"| node_shared_net
node_trino -->|"uses"| node_shared_net
node_jupyter -->|"uses"| node_shared_net
node_etl_app -->|"uses"| node_shared_net
node_env_file -->|"configures"| node_root_compose
node_makefile -->|"drives"| node_root_compose

click node_root_compose "https://github.com/ahadmammad/ing-lakehouse/blob/main/docker-compose.yml"
click node_env_file "https://github.com/ahadmammad/ing-lakehouse/blob/main/.env"
click node_makefile "https://github.com/ahadmammad/ing-lakehouse/tree/main/Makefile"
click node_airflow "https://github.com/ahadmammad/ing-lakehouse/tree/main/services/airflow"
click node_airflow_dags "https://github.com/ahadmammad/ing-lakehouse/tree/main/services/airflow/dags"
click node_nessie "https://github.com/ahadmammad/ing-lakehouse/tree/main/services/nessie"
click node_iceberg "https://github.com/ahadmammad/ing-lakehouse/tree/main/docs/iceberg"
click node_rustfs "https://github.com/ahadmammad/ing-lakehouse/tree/main/services/rustfs"
click node_rustfs_lb "https://github.com/ahadmammad/ing-lakehouse/blob/main/services/rustfs/config/nginx.conf"
click node_jupyter "https://github.com/ahadmammad/ing-lakehouse/tree/main/services/jupyter"
click node_trino "https://github.com/ahadmammad/ing-lakehouse/tree/main/services/trino"
click node_spark "https://github.com/ahadmammad/ing-lakehouse/tree/main/services/spark"
click node_hue "https://github.com/ahadmammad/ing-lakehouse/tree/main/services/hue"
click node_cloudbeaver "https://github.com/ahadmammad/ing-lakehouse/tree/main/services/cloudbeaver"
click node_etl_app "https://github.com/ahadmammad/ing-lakehouse/tree/main/services/etl-app/etl_app"
click node_etl_sources "https://github.com/ahadmammad/ing-lakehouse/tree/main/services/etl-app/etl_app/sources"
click node_etl_jobs "https://github.com/ahadmammad/ing-lakehouse/tree/main/services/etl-app/etl_app/jobs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_root_compose,node_shared_net,node_env_file,node_makefile toneBlue
class node_airflow,node_airflow_dags,node_airflow_workers toneAmber
class node_nessie,node_iceberg,node_rustfs,node_rustfs_lb toneMint
class node_jupyter,node_trino,node_spark,node_hue,node_cloudbeaver toneRose
class node_etl_app,node_etl_sources,node_etl_jobs toneIndigo
```

## Components

### Deployment

Compose files, env, and helper scripts that assemble the platform.

- [Root Compose](https://github.com/ahadmammad/ing-lakehouse/blob/main/docker-compose.yml): composition · Top-level Docker Compose layer that wires the services together. · `docker-compose.yml`
- **Lakehouse Net**: network · Shared Docker network used by all runtime services.
- [Env Vars](https://github.com/ahadmammad/ing-lakehouse/blob/main/.env): deployment config · Shared runtime variables such as ports and credentials. · `.env`
- [Make Targets](https://github.com/ahadmammad/ing-lakehouse/tree/main/Makefile): ops entrypoint · Convenience commands for starting, stopping, inspecting, and cleaning the platform. · `Makefile`

### Orchestration

Workflow scheduling and runtime control surfaces.

- [Airflow](https://github.com/ahadmammad/ing-lakehouse/tree/main/services/airflow): scheduler · Workflow orchestrator using CeleryExecutor for recurring jobs and validation. · `services/airflow`
- [DAGs](https://github.com/ahadmammad/ing-lakehouse/tree/main/services/airflow/dags): workflow defs · ETL and smoke-test workflows for crypto, weather, and lakehouse checks. · `services/airflow/dags`
- **Celery Workers**: execution · Distributed task execution layer for Airflow jobs.

### Data Plane

Metadata, table format, and object storage foundation.

- [Nessie](https://github.com/ahadmammad/ing-lakehouse/tree/main/services/nessie): iceberg catalog · REST catalog and metadata authority for Iceberg tables, refs, and history. · `services/nessie`
- [Iceberg](https://github.com/ahadmammad/ing-lakehouse/tree/main/docs/iceberg): table format · Cross-cutting table abstraction for ACID writes, schema evolution, and snapshots. · `docs/iceberg`
- [RustFS](https://github.com/ahadmammad/ing-lakehouse/tree/main/services/rustfs): object storage · Distributed object storage layer for Iceberg data and metadata files. · `services/rustfs`
- [Nginx LB](https://github.com/ahadmammad/ing-lakehouse/blob/main/services/rustfs/config/nginx.conf): reverse proxy · Front door for RustFS S3 and console endpoints. · `services/rustfs/config/nginx.conf`

### Access

Interactive notebooks and SQL/query front ends.

- [JupyterLab](https://github.com/ahadmammad/ing-lakehouse/tree/main/services/jupyter): notebook runtime · Interactive environment for Iceberg exploration, maintenance, and learning. · `services/jupyter`
- [Trino](https://github.com/ahadmammad/ing-lakehouse/tree/main/services/trino): sql engine · SQL query engine configured with a Nessie catalog for Iceberg access. · `services/trino`
- [Spark](https://github.com/ahadmammad/ing-lakehouse/tree/main/services/spark): compute engine · Distributed engine used for maintenance and adjunct lakehouse processing. · `services/spark`
- [Hue](https://github.com/ahadmammad/ing-lakehouse/tree/main/services/hue): sql ui · Browser-based SQL and administration surface. · `services/hue`
- [CloudBeaver](https://github.com/ahadmammad/ing-lakehouse/tree/main/services/cloudbeaver): sql ui · Additional browser-based database and SQL access tool. · `services/cloudbeaver`

### ETL App

Domain-specific ingestion and medallion-style transformation code.

- [ETL App](https://github.com/ahadmammad/ing-lakehouse/tree/main/services/etl-app/etl_app): python package · Domain ETL implementation organized by source, bronze, silver, and gold jobs. · `services/etl-app/etl_app`
- [Sources](https://github.com/ahadmammad/ing-lakehouse/tree/main/services/etl-app/etl_app/sources): connectors · External API clients and schemas for crypto and weather ingestion. · `services/etl-app/etl_app/sources`
- [Medallion Jobs](https://github.com/ahadmammad/ing-lakehouse/tree/main/services/etl-app/etl_app/jobs): transforms · Bronze, silver, and gold processing jobs for each domain. · `services/etl-app/etl_app/jobs`

## Connections

- Root Compose → Airflow: deploys · Composition layer assembles the orchestration service.
- Root Compose → Nessie: deploys · Composition layer assembles the metadata catalog service.
- Root Compose → RustFS: deploys · Composition layer assembles the storage cluster.
- Root Compose → Trino: deploys · Composition layer assembles the SQL engine.
- Root Compose → JupyterLab: deploys · Composition layer assembles the notebook service.
- Root Compose → Spark: deploys · Composition layer assembles the distributed compute engine.
- Root Compose → Hue: deploys · Composition layer assembles the SQL UI.
- Root Compose → CloudBeaver: deploys · Composition layer assembles the database UI.
- Airflow → DAGs: runs · Airflow schedules the repo's DAG definitions.
- Airflow → Celery Workers: executes on · Tasks are dispatched to Celery workers.
- DAGs → ETL App: invokes · DAGs trigger the custom ETL application code.
- ETL App → Sources: ingests from · ETL jobs pull data from external source clients.
- ETL App → Medallion Jobs: implements · ETL package contains bronze, silver, and gold transformations.
- Medallion Jobs → Nessie: writes via · Table operations go through the Iceberg catalog.
- JupyterLab → Nessie: reads/writes · Notebooks interact with the catalog for Iceberg workflows.
- JupyterLab → Iceberg: explores · Notebooks focus on Iceberg lifecycle and metadata concepts.
- Trino → Nessie: catalog · Trino uses Nessie as its Iceberg catalog.
- Spark → Nessie: catalog · Spark jobs and maintenance flows resolve tables through Nessie.
- Nessie → RustFS: stores metadata in · Catalog-managed table metadata ultimately persists in object storage.
- Iceberg → RustFS: data files · Iceberg table data and metadata files live in RustFS.
- RustFS → Nginx LB: fronted by · Nginx provides a stable entry point for RustFS APIs and console.
- Airflow → Lakehouse Net: uses · Runtime services communicate over the shared Docker network.
- Nessie → Lakehouse Net: uses · Catalog service is attached to the shared network.
- RustFS → Lakehouse Net: uses · Storage cluster is attached to the shared network.
- Trino → Lakehouse Net: uses · Query engine is attached to the shared network.
- JupyterLab → Lakehouse Net: uses · Notebook runtime is attached to the shared network.
- ETL App → Lakehouse Net: uses · ETL jobs reach shared services over the network.
- Env Vars → Root Compose: configures · Environment variables parameterize the deployment layer.
- Make Targets → Root Compose: drives · Make targets wrap common compose operations.
