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.
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.
- PostgreSQL – Stores house sales data.
- Kafka Connect (Debezium) – Streams changes from Postgres to Kafka (Bronze).
- Spark (Delta Lake) – Consumes stream, processes data, and writes to MinIO (Silver).
- Great Expectations – Validates data quality on the Silver layer.
- MLflow – Tracks model training experiments and serves the production model as a REST API.
- Streamlit Dashboard – Visualization and Prediction Interface.
git clone https://github.com/yourusername/MiniDataPlatform.git
cd MiniDataPlatformdocker compose up -d --buildNote: This starts all services including Airflow, Spark, Kafka, MinIO, MLflow, and the Dashboard.
- Access Airflow at http://localhost:8080 (User/Pass:
airflow/airflow). - Trigger the
end_to_end_pipelineDAG.- This will run Ingestion -> Processing -> Validation -> Training.
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.
| 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 | - |
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-servecontainer hosts the Production model on Port 5001.
[Postgres] -> (CDC) -> [Kafka] -> (Spark) -> [Delta Lake/MinIO] -> (Spark ML) -> [MLflow]
|
v
[Streamlit Dashboard]
- ✔️ 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