How ahadmammad/ing-lakehouse works
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 Root Compose · nessie Nessie · rustfs RustFS · airflow Airflow
Components 19
Deployment
Compose files, env, and helper scripts that assemble the platform.
- Root Compose · Top-level Docker Compose layer that wires the services together.
docker-compose.yml - Lakehouse Net · Shared Docker network used by all runtime services.
- Env Vars · Shared runtime variables such as ports and credentials.
.env - Make Targets · Convenience commands for starting, stopping, inspecting, and cleaning the platform.
Makefile
Orchestration
Workflow scheduling and runtime control surfaces.
Data Plane
Metadata, table format, and object storage foundation.
- Nessie · REST catalog and metadata authority for Iceberg tables, refs, and history.
services/nessie - Iceberg · Cross-cutting table abstraction for ACID writes, schema evolution, and snapshots.
docs/iceberg - RustFS · Distributed object storage layer for Iceberg data and metadata files.
services/rustfs - Nginx LB · Front door for RustFS S3 and console endpoints.
services/rustfs/config/nginx.conf
Access
Interactive notebooks and SQL/query front ends.
- JupyterLab · Interactive environment for Iceberg exploration, maintenance, and learning.
services/jupyter - Trino · SQL query engine configured with a Nessie catalog for Iceberg access.
services/trino - Spark · Distributed engine used for maintenance and adjunct lakehouse processing.
services/spark - Hue · Browser-based SQL and administration surface.
services/hue - CloudBeaver · Additional browser-based database and SQL access tool.
services/cloudbeaver
ETL App
Domain-specific ingestion and medallion-style transformation code.
- ETL App · Domain ETL implementation organized by source, bronze, silver, and gold jobs.
services/etl-app/etl_app - Sources · External API clients and schemas for crypto and weather ingestion.
services/etl-app/etl_app/sources - Medallion Jobs · Bronze, silver, and gold processing jobs for each domain.
services/etl-app/etl_app/jobs
Connections 29
- 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.