Hi everyone! I built a near-real-time app that follows every tram and metro train in Helsinki using only Databricks: no Kafka, no extra servers, and the whole thing deploys from one repository.
What the app does
- A live map of every tram and metro train, coloured by lateness and refreshed every 4 seconds
- Punctuality per route and direction, with a warning whenever the feed wasn't fully recorded
- An Ask tab where Genie answers "Is tram 4 on time right now?" and shows the SQL it ran
- Rider Reports: riders flag a late or crowded tram, and the report flows back into Unity Catalog
How it's built
- A custom PySpark Python Data Source reads HSL's open MQTT feed straight into a Lakeflow pipeline (bronze, silver, gold)
- A Lakebase synced table serves the live map in about 20 ms
- A serverless SQL warehouse and an AI/BI dashboard handle the analytics
- A Genie space, called from the app through the Conversation API
- A Streamlit Databricks App writes reports to Lakebase Postgres, and Lakebase Change Data Feed brings them back to Delta
- Everything is declared in one Declarative Automation Bundle
What I loved most: once I was clear on what I wanted to build, it took me about 6 hours.
Full story, with the architecture diagram, screenshots and the gotchas I hit along the way: Following Helsinki's trams in real time: a Databricks build story (Medium)
Code: github.com/SumeshKashyap/Helisinskis_trams_using_Databricks_apps_lakebase
Happy to answer questions, and I'd love to hear how you would build it differently.