kevin@portfolio:~$ cat projects/realtime-lakehouse.md
# Data Engineering · ML Infrastructure
Real-Time Big Data Lakehouse Platform
A containerized data platform from Kafka ingestion to medallion layers, model training, MLflow registry and an inference API.
Numbers
Problem
Streaming events need to become clean data, trained models and predictions without manual steps in between.
How it works
A Kafka producer streams review records into a Spark Structured Streaming job. The job writes Delta tables to MinIO in Bronze, Silver and Gold layers. A batch trainer reads the Silver table, labels each review positive when its rating is above 3, trains a Spark ML logistic regression on the text, logs it to MLflow and registers it. A FastAPI service serves predictions from the registry. Everything runs in Docker Compose.
› hover or tap a node for a one-line explanation
- Kafka producer Streams review records into a Kafka topic.
- Kafka Holds the event stream.
- Spark streaming ETL Parses events and writes each layer.
- Bronze Raw events as received.
- Silver Short or empty reviews dropped and a keyword-based sentiment label added.
- Gold A slim table of product, rating and sentiment.
- Batch trainer Trains on Silver and evaluates with AUC. It runs on startup, every 30 minutes and daily at 02:00.
- MLflow registry Tracks runs and registers the model.
- Model API FastAPI serves predictions.
Key decisions
- 01
Medallion layers on Delta tables in MinIO buckets, one bucket per layer.
- 02
Automated batch training that waits for Silver data and skips training when there are fewer than 100 rows.
- 03
One Docker Compose file starts every service, including Jupyter, Spark, MinIO and MLflow.
Results
- A full path from event to prediction that runs from one command.
- An exploratory notebook trained a review helpfulness classifier on about 20,000 reviews. It scored 79.44% accuracy and 83.77% F1 on a 25% hold-out.