HSLdevcom / transitdata

transitdata publishes GTFS Realtime interfaces
European Union Public License 1.2
10 stars 3 forks source link
transitdata

General

This system will read real-time data from various sources (for example, Pubtrans database regarding departures and arrivals) and convert those to GTFS real-time messages using a pipeline created with Apache Pulsar. The final step will publish the messages to different locations (such as MQTT brokers and blob storage).

General usage pattern is to build Docker images and then run them with docker-compose. Services are separated to different GitHub repositories, each containing the source code and the Dockerfile.

/bin-folder contains scripts to launch Docker images for Pulsar, Redis and Mosquitto MQTT broker which are requirements for some of the services.

Requirements

Overall system requirements for running the system are:

System Architecture & Components

Transitdata

Alt text

Transitdata input

Transitdata output

Transitlog

Alt text

Components are stored in their own Github Repositories:

Common dependencies

Transitdata components

Sources
Processors
Publishers
Other

These components are not connected to the Pulsar cluster, but they are deployed to the same environment as Transitdata and they produce data that Transitdata uses

Monitoring and testing

Transitlog HFP components

Note: this list does not contain all transitlog services. Search for transitlog in hsldevcom GitHub

Versioning

All of the main components in this project are versioned with the following scheme: x.y.z, where x is always 1, y is incremented when the output of the component is not backwards-compatible and z is incremented when the output is compatible. Most of the internal message protobufs include field for schema version, which can be used to make sure that incompatible messages are not processed. Because the services are deployed together at the same time, usually it is possible to just do changes to all necessary services at the same time.

The GTFS-RT output should conform to the GTFS Realtime standard, version 2.0.

Implementation notes

Pulsar seems to cause approximately 5ms of latency for each message, which is consistent with their promise. The latency is not a problem in itself, and is well within acceptable bounds. However, the latency means that a single-threaded consumer-producer loop can only process 200 messages per second.