How ocamposfaria/bees-data-engineering-case works
Project type and purpose
• This is a full-stack, containerized data engineering pipeline built with a medallion (bronze/silver/gold) architecture.
• Purpose: extract brewery data from the Open Brewery DB API, store it in an object store, transform it via Spark, and expose it through an AI-powered Streamlit dashboard.
File structure
• Top-level folders:
• airflow/ – orchestrates data extraction and ELT tasks
• minio/ – object storage service for Bronze/Silver/Gold layers
• spark/ – PySpark notebooks and runtime for transformations
• streamlit/ – interactive chat-based visualization app
• Configuration & orchestration artifacts: Dockerfiles and docker-compose YAML for each service, a shared Docker network, and a .env template.
Extract architecture insights from README
• Orchestration: Apache Airflow manages ELT DAGs (elt_001_breweries.py).
• Storage: MinIO buckets represent data lake layers:
• Bronze: raw JSON
• Silver: cleaned & partitioned Parquet
• Gold: aggregated Parquet & metadata
• Processing: PySpark notebooks for each layer in the spark/notebooks subfolders.
• Visualization: Streamlit app that pulls Gold metadata and integrates with the OpenAI API for chat queries.
Main components & relationships
a. External Services
• Open Brewery DB API (data source)
• OpenAI API (AI assistant in Streamlit)
b. Orchestration & Ingestion
• Airflow Scheduler & Webserver (Python container)
• DAG triggers requests.get tasks → writes raw JSON to MinIO Bronze bucket
c. Storage
• MinIO object store exposed on port 9001
• Bronze, Silver, Gold buckets
d. Processing
• Spark Master & Worker launched in Docker
• start-spark.sh initializes cluster
• Notebooks read Bronze data → write Silver → read Silver → write Gold
e. Visualization
• Streamlit app (port 8501)
• Reads Gold metadata from MinIO or local mount
• Sends user queries to OpenAI, visualizes responses
Architectural patterns & principles
• Medallion architecture: clear separation of data quality layers
• Container-per-service: each major component in its own Docker container
• Event-driven ELT: Airflow DAGs trigger periodic ingestion & transformations
• Modular & extensible: each layer’s logic isolated in notebooks and Python classes