For most of its history, Network Rail’s live data stayed inside Network Rail. This was the platform that opened it: real-time rail information, published to the public as customisable data feeds anyone could subscribe to and build on. Train movements, schedules, GPS positions and delays turned from an internal signal into an open-data resource. The Guardian covered the launch, and the apps that followed put live rail data to uses the railway had never built for itself.
Opening the data
The job was to take a live operational feed and make it safe and useful to hand out. The platform published the real-time picture of the network as feeds the open-data community could subscribe to and shape to their needs. Opening data sounds simple and is not: the source is a firehose in a format built for machines inside the railway, and the consumers are the public, who need it clean, reliable and documented. Middleware sat in that gap, turning a signal built for the railway into something the outside world could use.
The black cabs and the trains
The proof was in what people built. One flagship use put the feeds to work for London’s black cabs: an app that tracked trains into the city’s stations, so a driver could be waiting as a train arrived, and a passenger could see a delay before reaching the platform. It is a small, human thing, a cab in the right place at the right time, and it works only because live rail data is open and moving in real time. That is the case for open data in one example: hand people a live signal, and they solve problems no single team ever would.
Positions, borrowed from the skies
The hardest data to serve was position. Knowing where every train is, in real time, at national scale, is a demanding problem, and the answer came from an unexpected place: the same shape of problem had already been solved for aircraft moving through airports. The platform took that pattern, a CQRS design separating the fast-moving write side of position updates from the read side that served them out, and applied it to trains. Reusing a proven approach from aviation for rail positions was faster and safer than inventing one, and it shows an architecture travelling between domains that look nothing alike on the surface.
Built to stay up
Open feeds are a promise, and the promise is that they keep working. Once the public and a community of developers depend on live rail data, the platform cannot afford a bad day: an outage is not an internal inconvenience, it is every app built on top going dark at once. High availability was designed in from the start, with the event-driven core, the queues and the read models shaped so the feeds stayed up and stayed current under real traffic. That resilience was measured rather than assumed, with JMeter performance testing pushing the platform the way a busy day would.
The plumbing of an open platform
- Feeds to the community, over MQ. Message queues carried the data out to the open-data community, with Spring Integration handling the batch and routing that fanned a single live source out to many subscribers.
- A bespoke Ruby parser. One section of the source arrived in an awkward format of its own, so a purpose-built Ruby text parser turned it into something the platform could use.
- Two faces, public and admin. A public-facing portal for subscribers and the data they consumed, and an admin side to run the platform behind it, served through Apache.
- Tested and shipped with discipline. TDD and BDD kept behaviour correct as the platform grew, with Jenkins CI and Sonar quality gates on every change, all running on AWS.
From signal to service
Opening data is an engineering job before it is a policy one. It meant taking a live, national, machine-only signal and turning it into a public service: reliable feeds, a position model borrowed from aviation, a portal with a public and an admin face, and the odd bespoke parser where the source fought back. Carrying it from inception to production, growing from senior engineer into the technical lead along the way, meant owning both the architecture and the small team that shipped it. And all of it comes down to something small: a black cab already waiting when the train pulled in.
