Under the bonnet of BBC iPlayer v3
Do you want to know what TV and radio programmes your friends are enjoying? Want to track what you've played on iPlayer and keep that history wherever you are? These are just some of the cool new features that we've added to our latest release of iPlayer that's now in public beta. By integrating the site with BBC iD and other BBC services, we've put the emphasis firmly on personalisation.
So how have we done it?
To start with we've split iPlayer into a front end application written in PHP and a bunch of back end services. Our PHP layer is designed to be infinitely horizontally scalable. We don't maintain state or persist data through the PHP layer. This allows us to easily scale out the iPlayer application onto new servers and into new data centres as our traffic grows.
On the backend we use a combination of Java and Perl. The programme data publishing services have evolved from those we used for iPlayer v2. This is a Perl web service engine we call Dynamite, written using DBIx::Class and Catalyst. It provides a large range of endpoints allowing application developers to pick the feed best suited for their device. We return XML or JSON, structured as iPlayer Object Notation (ION). ION is used not just by PC iPlayer, but across the BBC on any website needing up to date programme metadata. ION and its underlying data structures rely on a constantly evolving and reactive caching strategy.
The new programme play and favourites tracking service which we call FUSE is a Java web service using Spring and Hibernate. We chose to stick with mySQL for the user activity database because this data is shared between FUSE and Dynamite.
Search and recommendations are also split out as separate services. This allows us to continually refine and improve these with minimal or no impact on service clients. It also allows us to use the features we've developed for iPlayer across other areas of bbc.co.uk.
Finally there is the issue of scaling and performance. We aim to serve all the iPlayer pages even in our peak traffic periods in under two seconds with the majority of requests served in under one second. Our site needs to be available 24 hours a day, 365 days a year. We minimise downtime by ensuring our site can remain up and active even when we lose 50% of our capacity. We implement safety modes in the service that switch off low priority activity when the service comes under load. Non-essential activities are handled asynchronously by message queues. Using Memcached we cache serialised objects and collections ready for quick reads.
We have only just started on the journey of personalising iPlayer and have lots of cool features coming along. Look out for personalised features appearing on the other iPlayer platforms including tablets, TVs, smart Phones and gaming consoles.
Marina Kalkanis is Senior Technical Architect, BBC iPlayer.
Read other recent posts on BBC iPlayer:
- Introducing coloured subtitles on BBC iPlayer
- BBC iPlayer on the iPad update: live streaming of World Cup
- BBC iPlayer press pack for May 2010
- Audience research and BBC iPlayer
- Your feedback on the iPlayer beta
- Going Social with the BBC iPlayer Beta
- Behind the scenes of BBC iPlayer
- BBC iPlayer on the iPad
- BBC iPlayer press pack for April 2010
- Introducing the all new BBC iPlayer (This time it's personal)