Data pipelinesWeb · Marketing
Real-time web sessions (Flink)
Live website clicks grouped into visits as they happen, with each visitor's location added
5 minof quiet ends a visit
See the code on GitHub (opens in a new tab)
Proof you can check:Code on GitHub
Data pipelines

Clicks become visits, live
3 sessions from one visitor: a new session starts after 5 min of quiet.
Lubo Bali · lubobali.com
The problem
Raw clickstream data doesn't say what a visit is. Without sessions, questions like "how long do people stay" can't be answered while the data is still fresh.
What I built
A Flink job that reads web events from Kafka, adds the visitor's location from their IP, groups events into sessions that end after 5 minutes of quiet, and writes the result to PostgreSQL and back to Kafka.
Tech & why
Flink works on event time with a watermark, so late or out-of-order clicks still land in the right session.
- Apache Flink
- Kafka
- PostgreSQL
- Python
The result
Live sessions per visitor and website, ready for clickstream analytics like average events per visit, while the data is still minutes old.
Similar projects
- Data pipelinesPortfolioScopeMy own website analytics: from one click to a daily dashboard, without Google Analytics104 s average visit, measured by my own tracker
- AI agentsLubo AI PublisherAn AI content pipeline that writes in my voice from real sources, and waits for my one tap9 posts a week, live since June 2026
- AI agentsThis site and its AI BlueprintDescribe a business problem and get a first AI plan in about 30 seconds, on this site30 s from your problem to a first plan, measured live
Have a problem like this? Get your free AI blueprint in about a minute.
