← all projects

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.

Timeframe
2025
Status
Public team project
Stack
Apache KafkaApache SparkPySparkMinIOMLflowPostgreSQLFastAPIJupyterLabDockerDocker Compose
Contribution
I built the pipeline end to end. I wrote the Spark streaming ETL job, the batch training engine, the MLflow service Dockerfile, a rewrite of the Docker Compose orchestration and a rewrite of the Kafka producer. I also wrote both pipeline notebooks and the README.

Numbers

3
Medallion layers (Bronze, Silver, Gold)

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.

Kafka producerKafkaSpark streaming ETLBronzeSilverGoldBatch trainerMLflow registryModel APIKafka producerKafkaSpark streaming ETLBronzeSilverGoldBatch trainerMLflow registryModel API
  1. Kafka producer Streams review records into a Kafka topic.
  2. Kafka Holds the event stream.
  3. Spark streaming ETL Parses events and writes each layer.
  4. Bronze Raw events as received.
  5. Silver Short or empty reviews dropped and a keyword-based sentiment label added.
  6. Gold A slim table of product, rating and sentiment.
  7. Batch trainer Trains on Silver and evaluates with AUC. It runs on startup, every 30 minutes and daily at 02:00.
  8. MLflow registry Tracks runs and registers the model.
  9. Model API FastAPI serves predictions.

Key decisions

  1. 01

    Medallion layers on Delta tables in MinIO buckets, one bucket per layer.

  2. 02

    Automated batch training that waits for Silver data and skips training when there are fewer than 100 rows.

  3. 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.