GeoPython2019

Using Python to build a scalable realtime information system for a railway service
2019-06-25, 09:15–09:45, Room 2

TRALIS is a realtime information system built by geOps for the Munich suburban
railway service (S-Bahn München), that powers the “live map” in the
official München Navigator mobile app. In this talk we show how we used Python
to build the backend service for this app, that delivers realtime updates to a
large number of clients via a scalable websocket API.


TRALIS is a realtime information system built by geOps for the Munich suburban
railway service (S-Bahn München). It powers the “live map” view in the
official München Navigator mobile app, showing a live view of all trains and
their current position, as well as live departure boards for stations.

In this talk we show how we used Python with AsyncIO, PostgreSQL/PostGIS and
Redis to build a fast and scalable backend for this service that can serve a
large number of clients.

The backend processes vehicle GPS positions and timetable updates, maps GPS
positions onto the rail network, and correlates realtime events with timetable
information to arrive at a unified view of the trains travelling on the ground.

Realtime updates are then delivered to clients via a websocket API layer. Since
the number of active clients can be large and highly variable (e.g. in case of
a service disruption), the application is built in such a way that clients are
decoupled from the backend processing and critical components are scaled
automatically to maintain optimal performance.