This case study does not exist yet.
Return to the project library and choose another project.
Back to Projects →Monzo user sentiment insights dashboard
A robust event-streaming and lakehouse infrastructure processing over 10M actions daily to power live dashboard telemetry.
Project Overview
This project implements a scalable real-time data ingestion and analytics pipeline. Designed to capture clickstream events, user transaction data, and inventory updates, this pipeline channels unstructured data directly into a unified lakehouse pattern. The goal is to provide instantaneous sales telemetry, real-time stock levels, and session-by-session behavioral analytics to product and marketing teams.
Using a combination of Apache Kafka for stream brokering, Spark Structured Streaming for schema reinforcement and transformations, and Delta Lake on AWS S3 for the storage tier, we achieved sub-second latency for complex analytical queries.
The Problem
Prior to the new pipeline, e-commerce transactions and catalog change events were processed via batch jobs running every 6 hours. This resulted in significant data latency, preventing live alerts for inventory depletion and causing marketing campaigns to target users with recently sold-out products. Furthermore, concurrent read/write locks on the legacy relational database during analytics queries degraded consumer-facing portal performance.
The team needed a solution capable of handling bursty clickstream volume during peak hours without impacting database performance, while enforcing ACID transaction properties on the destination analytical store.
Key Requirements
Ingested Data Sources
Transactions Store
Inventory Database
Ad Campaign Telemetry
Pipeline Architecture Diagram
Interactive project architecture diagram.
End-to-End Pipeline Phases
Event Capture
Stateless API Gateways forward stream payloads directly into individual Kafka topic partition pools.
Stream Ingestion
Structured PySpark streams continuously poll Kafka topics, enforcing baseline parsing rules.
Schema Guard
Validation step checking structures against the centralized AVRO schema catalog before commit.
Medallion Lakehouse
Bronze (raw JSON), Silver (enriched schema), and Gold (aggregates) Delta tables write sequentially.
Data Warehouse Schema Design
Interactive schema design.
Data Quality & Observability Metrics
Schema Compliance
Target: 100% strictly enforced
Validation Pass Rate
Zero silent failures allowed
SLA Adherence
Pipeline uptime metric
Critical Engineering Tradeoffs
Spark Streaming over Flink
Delta Lake over Parquet
Pipeline Implementation & Syntax Snippets
from pyspark.sql import SparkSession
from pyspark.sql.functions import from_json, col
# Initialize structured stream reading from broker...
df = spark.readStream.format("kafka") \
.option("kafka.bootstrap.servers", "broker:9092") \
.option("subscribe", "events") \
.load()
Conclusion
Impact of the implementation
The case study demonstrates how a stream-first architecture can reduce analytical latency, isolate transactional workloads from reporting activity, and create a governed foundation for live operational analytics.
Take Aways
The strongest outcomes came from separating ingestion, validation, transformation and serving concerns, then making observability and schema enforcement first-class parts of the pipeline rather than afterthoughts.