Skip to content

About

MiniDataPlatform using docker

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

MiniDataPlatform

A simple end-to-end data engineering and ML platform for streaming PostgreSQL data through Kafka, transforming it with Spark, validating quality, training models, and serving predictions. Built for educational purposes using Docker.

📦 Project Structure

  • docker-compose.yml – Main orchestration file for services.
  • dags/ - Airflow DAGs for pipeline orchestration.
  • jobs/ - Spark jobs for data processing (Bronze -> Silver).
  • scripts/ - Ingestion scripts for simulating data sources.
  • quality/ - Great Expectations validation scripts.
  • ml/ - Machine learning scripts (Training & Serving).
  • dashboard/ - Streamlit dashboard application.
  • connect/ – Kafka Connect container with Debezium + Avro converters installed.

🚀 How It Works

  1. PostgreSQL – Stores house sales data.
  2. Kafka Connect (Debezium) – Streams changes from Postgres to Kafka (Bronze).
  3. Spark (Delta Lake) – Consumes stream, processes data, and writes to MinIO (Silver).
  4. Great Expectations – Validates data quality on the Silver layer.
  5. MLflow – Tracks model training experiments and serves the production model as a REST API.
  6. Streamlit Dashboard – Visualization and Prediction Interface.

🧪 Quick Start

1. Clone the Repository

git clone https://github.com/yourusername/MiniDataPlatform.git
cd MiniDataPlatform

2. Start the Stack

docker compose up -d --build

Note: This starts all services including Airflow, Spark, Kafka, MinIO, MLflow, and the Dashboard.

3. Trigger the Pipeline

  1. Access Airflow at http://localhost:8080 (User/Pass: airflow/airflow).
  2. Trigger the end_to_end_pipeline DAG.
    • This will run Ingestion -> Processing -> Validation -> Training.

4. Access the Dashboard

Go to http://localhost:8501 to view the House Value Insights Dashboard.

  • Pipeline Status: View data ingestion completeness.
  • Data Distribution: Explore the dataset.
  • Model Performance: See the latest training metrics (RMSE, R2).
  • Predict: Use the form to get real-time price predictions from the Production model.

📊 Endpoints

Service URL Credentials
Dashboard http://localhost:8501 -
Airflow http://localhost:8080 airflow / airflow
MLflow http://localhost:5000 -
MinIO http://localhost:9001 minioadmin / minioadmin123
Postgres (Source) localhost:5432 myuser / mypassword
Spark Master http://localhost:9090 -

🧠 Machine Learning

The platform includes a Production-Grade ML pipeline:

  • Model: Gradient Boosted Trees (GBTRegressor) via Spark MLlib.
  • Training: Automatically split 80/20 train/test.
  • Lifecycle: The best model is automatically transitioned to "Production" stage in MLflow.
  • Serving: mlflow-serve container hosts the Production model on Port 5001.

📂 Data Flow

[Postgres] -> (CDC) -> [Kafka] -> (Spark) -> [Delta Lake/MinIO] -> (Spark ML) -> [MLflow]
                                                   |
                                                   v
                                             [Streamlit Dashboard]

✅ Features

  • ✔️ PostgreSQL CDC streaming via Debezium
  • ✔️ Kafka Avro serialization & Schema Registry
  • ✔️ Spark Structured Streaming & Delta Lake
  • ✔️ Data Quality Validation (Great Expectations)
  • ✔️ Automated ML Training & Experiment Tracking
  • ✔️ Real-time Model Serving & Dashboarding

About

MiniDataPlatform using docker

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages