Visualising Radio, pushing, not pulling
This morning the department I work for at the BBC launched a new visual radio player. You can find out all about the motivation behind the product from my colleague Yasser, over on the Radio Labs blog, but as one of the engineers on the project, I thought I’d give a quick overview of the different technologies we used to create the experience. There will also be a technical overview on the Radio Labs Blog too.
So, the big news here is that we are pushing and not pulling. Ordinarily, you would request a webpage using your browser and a some data would be returned. The only way that you would then subsequently see any changes to that data, would be if you requested it again, or if something on that page requested it for you, maybe via polling.
We decided to go the other way, and push information to the page. When the user opens up the Visualising Radio Client, (a dumb, but not stupid Flash application), the first thing it does is create a XMLsocket connection back to a server. This means that we have a path back to that client, and it’s the same for all the others that are connected.
On the server side we have our admin console. This is a Ruby on Rails app (2.2.2) and allows the studio team to prepare content to send to the clients. We also have a bunch of background processes running that prepare our databases, and do various other tasks including sending messages to our message broker.
So, if the Radio team want to push content to all the people connected via the Visualising Radio console, they will activate the specific module they want to show and a chain of events occur. At at a high level, are:
- A message containing a url to a resource is put on a queue on our ActiveMQ message broker
- A process watching this queue, see’s the message and parses it
- A request is made back to the resource url above, which returns some XML
- This XML is then posted to a server
- This server then sends this data off to all the clients connected
- The client parses this XML and displays the information to the user
This all happens very quickly, and is very effective. Especially in the fast paced environment of a radio show.
The trial continues for the rest of the week with Chris Moyles, check it out and see what you think.