← All selected work

Streaming data platform

Clickstream

A production-shaped clickstream pipeline built to test the full path from event generation to a monitored read API.

ScopePortfolio build using synthetic events and short-run local or kind-cluster measurements. Not an employer production system.

producer throughput
~100 events/s
API under load
p95 181 ms
Python tests
111
  • Python
  • Kafka
  • Spark
  • PostgreSQL
  • ClickHouse
  • FastAPI

01 / Context

The problem

Streaming projects often stop at a dashboard. The harder question is whether the event contract, state model, query layer, and failure paths hold together when data is late, duplicated, malformed, or temporarily unavailable.

02 / Architecture

How the system fits together

  1. 01Producer~100 events/s
  2. 02Kafkaclicks.raw + DLQ
  3. 03Spark1-minute windows
  4. 04PostgreSQLcurated aggregates
  5. 05ClickHouseanalytics storage
  6. 06FastAPIread-only API
  7. 07GrafanaSLIs and alerts

Supporting systems

  • Airflowfreshness and rollups
  • dbtmodels and tests
  • Sodadata-quality checks
  • Terraform / EKStime-boxed cloud run
Synthetic traffic · local and kind-cluster measurements

03 / Engineering

What I built

  • Built a deterministic producer and Kafka ingestion path, then processed one-minute windows in Spark Structured Streaming with watermarking and a dead-letter topic.
  • Modeled curated data for PostgreSQL and analytical data for ClickHouse, with idempotent upserts and a read-only FastAPI serving layer.
  • Added Airflow orchestration, dbt models and tests, data-quality checks, Redis caching, rate limiting, and a Go operations CLI.
  • Instrumented the system with Prometheus and Grafana, then added SLOs, runbooks, k6 load tests, and chaos drills.
  • Deployed through Docker Compose and kind/Helm, with a time-boxed Terraform/EKS run that was destroyed in the same session.

04 / Evidence

Measured outcomes

05 / Demo

Product evidence

Clickstream Grafana dashboard showing freshness, Kafka throughput, queue depth, and API latency panels
Operational dashboard for pipeline freshness, throughput, and API latency.
Prometheus alert rules for Kafka consumer lag, API latency, and dead-letter queue depth
Alert rules cover lag, API latency, and dead-letter messages.
OpenAPI documentation for the read-only Clickstream API
The read-only API exposes summary, events, timeline, and health endpoints.

06 / Boundaries

Trade-offs and limitations

  • The system uses synthetic events, a short measurement window, and a single-node Kafka configuration.
  • It demonstrates production-shaped engineering, not production traffic, multi-region resilience, or a long-running SLO history.

07 / Sources

Inspect the work