<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet title="XSL_formatting" type="text/xsl" href="/blogs/shared/nolsol.xsl"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>

<title>
BBC Internet Blog
 - 
David Rogers
</title>
<link>https://bbcbreakingnews.pages.dev/blogs/bbcinternet/</link>
<description>Staff from the BBC&apos;s online and technology teams talk about BBC Online, BBC iPlayer, and the BBC&apos;s digital and mobile services. The blog is reactively moderated. Posts are normally closed for comment after three months. Your host is Eliza Kessler. </description>
<language>en</language>
<copyright>Copyright 2012</copyright>
<lastBuildDate>Wed, 01 Aug 2012 18:00:00 +0000</lastBuildDate>
<generator>http://www.sixapart.com/movabletype/?v=4.33-en</generator>
<docs>http://blogs.law.harvard.edu/tech/rss</docs> 


<item>
	<title>Building the Olympic Data Services</title>
	<description><![CDATA[<div class="imgCaptionCenter" style="text-align: center; display: block; ">
<img alt="Peaks in data traffic for volleyball and badmington" src="https://bbcbreakingnews.pages.dev/blogs/bbcinternet/2012/08/01/messages_per1000s.png" width="513" height="434" class="mt-image-center" style="margin: 0 auto 5px;" /><p style="width:513px;font-size: 11px; color: rgb(102, 102, 102);margin: 0 auto 20px;">Monitoring data for badmington and volleyball during the 2012 Olympics </p></div>
<p>Twelve months ago, there were three of us in the new Olympic Data Team: product manager Oliver Bartlett, developer David Norris, and I, David Rogers, as technical lead. We were tasked with providing data for the BBC's Olympics 2012 project: stats, events, results...</p>
<p>Today, we are a team of 20, we have built&nbsp;five applications, provide 174 endpoints, manage 50 message queues and support&nbsp;ten separate BBC Olympic products -&nbsp;from the sport website to the Interactive Video Player.</p>
<p>Over the course of the games, we expect to process over four million messages, such as athlete profiles, diving events from the Aquatic Centre or the latest medal table for Team GB. Throughout the project, there have been two distinct, but closely-linked objectives.</p>
<h2>Two Objectives</h2>
<p>Firstly, we needed to build a high-throughput, low <a href="http://en.wikipedia.org/wiki/Latency_(engineering)">latency</a> message processing system, making sure the facts and figures emerging from the Olympic venues were available, throughout the BBC, quickly and accurately.</p>
<p>Secondly, we wanted this data to be part of a wider story, ensuring the wealth of BBC content, such as news, blogs, galleries, video and live commentary could be seen alongside the live data, and presented to suit a range of audiences. This second objective is best exemplified by the 10,490 athlete pages on the BBC sport website, each offering a dynamic and meaningful aggregation of content, all based around an individual Olympian.</p>]]><![CDATA[<h3>1: High-throughput message processing Olympic Data</h3>
<p><em>Receiver, Router, API and the Content Store</em></p>
<p>The feed we receive from our data provider, <a href="http://www.deltatre.com/">DeltaTre</a>, is a high-throughput XML feed.</p>
<p>We needed to build a system that was capable of receiving and processing thousands of messages every minute.</p>
<p>We needed to be able to prioritise the messages, so that we process the real-time data before the bulk updates. For example, when the triathalon finishes, we receive a detailed statistical update for every competitior. These messages can wait, what we really need is the result. To ensure we receive the most timely information first, we split all messages into a set of 50 queues, we then tune the processing rate for each queue to make sure we can show the most up-to-date view of the Olympics where it really matters.</p>
<h3>2: Connecting content across the BBC</h3>
<p><em>TRiPOD 2012, DSP and the Triple Store</em></p>
<p>The second objective of the project was to take the data feed and weave it seamlessly into the rest of the BBC Olympic content, using <a href="https://bbcbreakingnews.pages.dev/blogs/radiolabs/s5/linked-data/s5.html">linked data</a> in our <a href="http://en.wikipedia.org/wiki/Triplestore">triple store</a>. To achieve this, we have integrated the Olympic data with the BBC&rsquo;s <a href="https://bbcbreakingnews.pages.dev/blogs/bbcinternet/2012/04/sports_dynamic_semantic.html">Dynamic Semantic Publishing</a> platform - developed for the FIFA World Cup 2010 and <a href="https://bbcbreakingnews.pages.dev/blogs/bbcinternet/2012/04/sports_dynamic_semantic.html">blogged about by my colleague Jem Rayfield</a>. This approach, in the context of the Olympics, can be summarised by the following 3-step process:</p><p>
<ol>
<li>Convert the athlete, world record and podium XML data into RDF and publish this into our OWLIM triple store</li>
<li>Journalists, and other creators of BBC content, can now &lsquo;tag&rsquo; articles, blogs, galleries or videos with Olympic athletes, venues, sports, events and teams</li>
<li>This results in <a href="https://bbcbreakingnews.pages.dev/sport/olympics/2012/athletes/82f5db84-0591-49ee-b6f4-a1d26e9381fb">rich, dynamic aggregations of BBC content</a></li>
</ol></p>
<h3>BBC Olympics Data Service</h3>
<p>The resulting system fuses these two objectives into a single service, allowing applications to leverage both the real-time XML data, and the richly interconnected semantic data.</p>
<div class="imgCaptionCenter" style="text-align: center; display: block; ">
<img alt="Real time data flows into the real-time systems as well as the linked data store." src="https://bbcbreakingnews.pages.dev/blogs/bbcinternet/2012/08/01/01_flowchart_down_595.png" width="595" height="942" class="mt-image-center" style="margin: 0 auto 5px;" /><p style="width:595px;font-size: 11px; color: rgb(102, 102, 102);margin: 0 auto 20px;">The BBC Olympic Data Service, showing the high-throughput message processing (left and centre) integrated, using linked data, with content from around the BBC (right) </p></div>
<h2>The Technical Challenges</h2>
<h3>Racing the video into the IVP</h3>
<p>The Interactive Video Player is the most complex, but in my opinion, most exciting online offering from the BBC for the 2012 games.</p>
<p>It shows any one of our 24 high-definition video streams, but also provides an interactive panel showing real-time stats about the events taking place in the video. This behaviour represents a significant challenge.</p>
<p>Our AV teams have invested greatly in reducing the latency for our online video output, crucial for live events during an Olympic Games. Unfortunately, the lower the video latency, the less time we have to provide the accompanying stats.</p>
<p>The diagram below shows how we modelled the various latencies, delays and caching layers involved:</p>
<div class="imgCaptionCenter" style="text-align: center; display: block; ">
<img alt="Diagram of how the system synchronises video with data in different circumstances." src="https://bbcbreakingnews.pages.dev/blogs/bbcinternet/2012/08/01/02_ivp-polling-latest_595.png" width="595" height="391" class="mt-image-center" style="margin: 0 auto 5px;" /><p style="width:595px;font-size: 11px; color: rgb(102, 102, 102);margin: 0 auto 20px;">Modelling the dataflow, from the venue to the screen </p></div>
<p>We explored two competing methods of providing stats to the IVP:</p>
<p><ol>
<li>Obtain stats in discrete blocks of time. e.g. &ldquo;Stats for the time period 12:10pm-&gt;12:20pm&rdquo; with each time period a different API URL&nbsp;</li>
<li>Obtain stats from the same API URL, receiving an updated &lsquo;last X events&rsquo; each time </li>
</ol></p>
<p>Both methods have been used, the first method for video-on-demand, and the second for live video.</p>
<p>Here, the two methods of obtaining stats are compared.</p>
<table border="0">
<tbody>
<tr>
<th>Method</th><th>Method 1: Blocks of time</th><th>Method 2: Latest X stats</th>
</tr>
<tr>
<th>URL</th>
<td>/stats/{datetime} (time period is fixed, so starting time is provided)</td>
<td>/stats/latest</td>
</tr>
<tr>
<th>Worst-case scenario</th>
<td>Stats are requested before they have been received</td>
<td>Stats are so frequent, that more than X stats occur between each poll</td>
</tr>
<tr>
<th>Caching</th>
<td>Between 10 seconds and 4 hours, depending on how old the stats are</td>
<td>~3 seconds</td>
</tr>
<tr>
<th>Used for</th>
<td>Video-on-demand<br />Live-rewind &gt; 2 mins</td>
<td>Live video<br />Live-rewind &lt; 2 mins</td>
</tr>
</tbody>
</table>
<p>The trickiest aspect of this two-method approach is to transition between the two methods.</p>
<p>When watching the IVP, it is possible to &lsquo;time-slip&rsquo; if the connection is poor. If the user drifts back over two minutes, they will shift from method&nbsp;two to method one. We used a technique of &lsquo;snapshots&rsquo; to overcome not just these transitions, but also the times when an audience member moves around the stream, for example, returning to live after watching a goal from 20 minutes ago.</p>
<p>Prior to the games, we did prototype &lsquo;push&rsquo; technologies such as <a href="http://en.wikipedia.org/wiki/Push_technology#Long_polling">long-polling</a> to solve the same problem. Unfortunately, this was too great a technical challenge to solve in time for the games, particularly given our requirement to scale to millions of users.</p>
<p>As the video latency reduces, &lsquo;push&rsquo; will become the only viable option for real-time stats.</p>
<h3>Building APIs rapidly within a rich domain</h3>
<p>The domain of Olympic sport is both deep and broad.</p>
<p>We have had to deal with schedules, video logging, statistics, athlete meta-data, photos, medal tables and more.</p>
<p>Within each type of data, there is a huge variety according to sport.</p>
<p>For example, football schedules are arranged into two distinct phase: league and knock-out, with each match comprising two teams, where each team is comprised of a squad of players. Events within a match include red cards, fouls, half-time and goals.</p>
<p>By comparison, this is how <a href="http://en.wikipedia.org/wiki/Archery_at_the_Summer_Olympics">Wikipedia describes &lsquo;Individual Archery&rsquo; competitions</a>:</p>
<blockquote>
<p>&ldquo;64 archers compete. The competition begins with the ranking round. Each archer shoots 72 arrows (in six ends, or groups, of 12 arrows). They are then ranked by score to determine their seeding for the single-elimination bracket. After this, final rankings for each archer is determined by the archer's score in the round in which the archer was defeated, with the archers defeated in the first round being ranked 33rd through 64th."</p>
</blockquote>
<p>This complexity is represented within the XML, where the the schema for each type of XML we receive can be extremely complex, having to represent varieties between sports, events, and even different phases of the same event.</p>
<p>In addition to this, like most software projects, the requirements were subject to frequent change.</p>
<p>Within this context, we needed to build a system to ingest, process and provide this data.</p>
<p>To achieve this, we adopted two approaches, "light-touch" and "best-effort", and relied on an XML Database:</p>
<h4>Light-touch</h4>
<p>We chose not to validate or model the content of the XML unless absolutely necessary. For example, take the medal table. If possible, we could receive the XML, identify that it represented a medal table by examining a single element, and from this point onwards, ignore the rest of the contents.</p>
<p>In reality, we needed to verify, route, process or enrich most of the data.</p>
<p>Where this was necessary, we only accessed or manipulated a small proportion of the XML. Using this approach, our data provider could make significant changes to the structure of the XML without any changes to our APIs necessary.</p>
<p>Ultimately, our clients - the systems that created visual representations of the data -&nbsp;would need to use the more complex, domain-specific detail. These clients did not, however, have to wait for us to update our models, schema or validation logic.</p>
<h4>Best-effort</h4>
<p>Closely associated with the approach above was the idea of &lsquo;best-effort&rsquo; responses. This was the idea that, whatever the circumstance, it was better to delivery some content, within a known timescale, rather than nothing at all. This would leave the client the option to gracefully degrade the user-facing content as they saw fit.</p>
<p>Behind this principle is the knowledge that we will not have many options for updating and re-releasing our systems during the two-week window of the games.</p>
<h4>MarkLogic XML database</h4>
<p>Fundamental to this approach was the use of MarkLogic to store and retrieve data. MarkLogic is an<a href="http://en.wikipedia.org/wiki/XML_database"> XML database</a> which uses <a href="http://www.w3.org/TR/xquery/">XQuery</a> to store and retrieve data.</p>
<p>Given the timescales, this project would not have been achievable using a SQL database, which would have pushed the design towards more complete modelling of the data.</p>
<p>Using MarkLogic, we could write a complete XML document, and retrieve that document either by reference to its location, a URI, or using XQuery to define criteria about its contents.</p>
<p>For example, all documents matching a particular <a href="http://www.w3.org/TR/xpath/">XPath</a> could be obtained.</p>
<h3>Simulating the Olympics</h3>
<p>When building a complex software product, the common sense approach is to get the software in front of your customers as soon as you can. We&rsquo;ve done this where we could - we had pages-per-athlete, venue and event ready early in the year. We used the Interactive Video Player for Euro 2012 and Wimbledon.</p>
<p>The problem is, without an Olympics Games happening, you have neither realistic data, nor the audience levels, to genuinely put the product to the test.</p>
<p>To get around this problem, we have invested a significant proportion of our efforts to simulate the Olympics. The most obvious manifestation of this was the Olympics Simulator application. This allowed people around the business to set up streams of data which could simulate anything from an athlete registering for the games, live stats for different sports, video logging information or medals being won.</p>
<p>The simple interface provided is shown below.</p>
<div class="imgCaptionCenter" style="text-align: center; display: block; ">
<img alt="Screenshot of the web form interface to the simulator." src="https://bbcbreakingnews.pages.dev/blogs/bbcinternet/2012/08/01/03_simulator_595.png" width="595" height="342" class="mt-image-center" style="margin: 0 auto 5px;" /><p style="width:595px;font-size: 11px; color: rgb(102, 102, 102);margin: 0 auto 20px;">BBC Olympic Simulator interface </p></div>
<p>These streams of data could then be synchronised with video to provide a rich and dynamic user experience on bbc.co.uk, or our test environments, without waiting for the Olympics to begin.</p>
<h3>There is no dress rehearsal</h3>
<p>Whilst simulations, load testing, stress testing and end-to-end testing have built a lot of confidence, we were still facing a &lsquo;big-bang&rsquo; on July 27th when two things happened:</p><p>
<ol>
<li>Millions more people started using the BBC Olympics website - using features that were not active before the games, such as medal tables, live stats, live logging events and the &lsquo;Olympics Live&rsquo; feed from around the games</li>
<li>Messages are delivered by DeltaTre in much higher volume</li>
</ol></p>
<p>To give ourselves flexibility, we have created a number of &lsquo;knobs and levers&rsquo; to control our applications in production.</p>
<p>These include the following:</p><p>
<ol>
<li><strong>Message flow control</strong>: If, for example, the sport of boxing is generating too much statistical data, we could deprioritise these messages in favour of the other sports. </li>
<li><strong>Caching timeouts</strong>: If we discover that an endpoint has become resource intensive, we can raise the caching timeouts to reduce the number of times we need provide data each minute or hour. </li>
<li><strong>Keyword whitelists</strong>: We have decided in advance what log event information we would like to be displayed in different areas of the the site. For example, for football, we want a &lsquo;red card&rsquo; to result in a marked Chapter Point in the video, so our audience can rewind back to this event. </li>
</ol></p>
<p>We may discover during the games that the pattern of events is not what we expected; being able to change how we respond to these different events will allow us to fine-tune the user experience in real-time.</p>
<h2>Legacy</h2>
<p>Creating systems, libraries and techniques that could be used beyond the games was crucial for this project. We wanted this unprecedented investment in the Olympics to have lasting, tangible benefits for the BBC and its audience.</p>
<p>Here are some of them:</p>
<ul>
<li><strong>Data, fit for reuse</strong>: A proportion of the data gathered for the games has been published to our linked data platform using the BBC&rsquo;s sport ontology. Although still evolving, this ontology will allow us to continue to integrate future sporting events with the past. Athletes, sports, events and venues will all maintain consistent identifiers, and BBC content will be associated with these concepts. Ultimately, we hope to provide access to this data publicly, allowing people to build applications with access to the breadth and depth of BBC content. With the BBC obtaining the rights for the Olympics up to 2020, we can already start to think about how this data will be useful for Rio 2016! </li>
<li><strong>Libraries</strong>: For this project we have built a set of software libraries for reuse around the BBC. A RESTful API framework produced for this project is already used in the systems that power the BBC mobile news website, and the football section of the BBC Sport website. </li>
<li><strong>Applications</strong>: The TRiPOD 2012 API, built to power the Olympics, will live on as the backbone of the BBC Sport website, showing the competitions, competitors, venues and teams of all the sport covered by the BBC. </li>
<li><strong>Persistent Stores</strong>: The Olympics Data projects have pushed both MarkLogic and OWLIM to their limits and we have discovered better ways of working with these stores. This best practice, often captured in software tools, has been established for future projects. </li>
</ul>
<p>With the Olympics now underway, we&rsquo;ve had a chance to see these approaches used for real. Whilst we have had to make use of our &lsquo;real-time controls&rsquo; to adjust and fine-tune the user experience, I believe we have created something that sets the BBC apart for this first &lsquo;digital Olympics&rsquo;.</p>
<p>I look forward to reading your comments.</p>
<p><em>David Rogers is a Senior Techincal Architect,&nbsp;BBC Future Media, News &amp; Knowledge</em></p>]]></description>
         <dc:creator>David Rogers 
David Rogers
</dc:creator>
	<link>https://bbcbreakingnews.pages.dev/blogs/bbcinternet/2012/08/olympic_data_xml_latency.html</link>
	<guid>https://bbcbreakingnews.pages.dev/blogs/bbcinternet/2012/08/olympic_data_xml_latency.html</guid>
	<category>BBC Sport</category>
	<pubDate>Wed, 01 Aug 2012 18:00:00 +0000</pubDate>
</item>

<item>
	<title>Guardian Hackday</title>
	<description><![CDATA[<P>At the end of July the Guardian held an internal <a href="http://www.guardian.co.uk/media/pda/2009/jul/31/hacking-opensource1">hackday</a> at their offices in King's Cross. They invited two engineers from BBC Radio's A&Mi department, <a href="http://www.chrislowis.co.uk">Chris Lowis</a> and David Rogers. We teamed up with Leigh Dodds & Ian Davis from Semantic Web specialists, <a href="http://www.talis.com/">Talis</a> to produce an 'Interactive-MP-Media-Appearance-Timeline' by mashing up data from BBC Programmes and the Guardian's website.</P>
<P>
Before the event <a href="http://www.talis.com">Talis</a> extracted data about MPs from the <a href="http://www.guardian.co.uk/open-platform">Guardian's Open Platform API</a> and converted it into a <a href="http://api.talis.com/stores/guardian">Linked Datastore</a>. This store contains data about every British MP, the Guardian articles in which they have appeared, a photo, related links and other data. Talis also provide a <a href="http://www.w3.org/TR/rdf-sparql-query/">SPARQL</a> endpoint to allow searching and extraction of the data from the store. 
</P><P>
Coincidentally, the BBC programmes data is <a href="https://bbcbreakingnews.pages.dev/programmes/developers">also available as a linked datastore</a>. By crawling this data using the MP's name as the search key we were able to extract information about the TV and radio programmes in which a given MP had appeared. A second datastore was created from the combination of these two datasets, and by pulling in some related data from <a href="http://dbpedia.org">dbpedia</a>. Using this new datastore we created a web application containing an embedded visualisation of the data.
</P><P>
We created the web using the lightweight ruby web-framework <a href="http://www.sinatrarb.com">Sinatra</a>. A simple <a href="http://en.wikipedia.org/wiki/Representational_State_Transfer">RESTful URL</a> schema provided access to a web page showing basic information about an MP.
<BR>
<img alt="mps_appearances_600.png" src="https://bbcbreakingnews.pages.dev/blogs/bbcinternet/img/mps_appearances_600.png" width="600" height="422" class="mt-image-left" style="float: left; margin: 0 20px 20px 0;" />
<BR>
In addition we queried the datastore to give a list of all of the MPs appearances across Guardian and BBC content. This was returned as a JSON document, and passed to an embedded <a href="http://processing.org/">Processing</a> Java applet. A Java applet may seem like an unusual choice in 2009, but Processing is an excellent choice for the rapid development of responsive graphics applications, due to its integration with existing JAVA libraries, and its powerful graphics framework.
<P>
Leigh at Talis put together a <a href="http://www.talis.com/platform/demos/">screencast</a> showing the app in action. The Processing applet shows a month-by-month scrollable timeline. The user can move back and forward in time, at variable speeds, by pressing the mouse either side of the applet frame. In each month slot, a stack of media appearances is displayed, represented by the logo of the BBC brand, or in the case of Guardian articles, the Guardian brand. Moving the mouse over a media appearance reveals the headline or programme description and clicking a media appearance will navigate the browser to the episode page on the <a href="https://bbcbreakingnews.pages.dev/programmes">/programmes</a> or the article page on <a href="http://www.guardian.co.uk">guardian.co.uk</a>.
</P><P>
We demonstrated the application to the hackday audience, and in the prize giving ceremony were awarded the 'Best use of third-party data' award. We think that the application demonstrates some of the ways the structured RDF data provided by BBC's <a href="https://bbcbreakingnews.pages.dev/programmes">/programmes</a> website can be used. This project shows how powerful the linked-data concept is when used in conjunction with other data that has been exposed in a similar way. As more media organisations expose their domains in this manner, more interesting and wide-reaching visualisations and web-applications can be built.
</P>

<em>David Rogers is a Software Engineer, Future Media & Technology for BBC Audio & Music & Mobile.</em>]]></description>
         <dc:creator>David Rogers 
David Rogers
</dc:creator>
	<link>https://bbcbreakingnews.pages.dev/blogs/bbcinternet/2009/08/at_the_end_of_july.html</link>
	<guid>https://bbcbreakingnews.pages.dev/blogs/bbcinternet/2009/08/at_the_end_of_july.html</guid>
	<category>innovation</category>
	<pubDate>Tue, 25 Aug 2009 10:20:24 +0000</pubDate>
</item>


</channel>
</rss>

 
