<?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
 - 
Richard Summers
</title>
<link>https://bbclatestnews.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>Mon, 28 Mar 2011 21:07:59 +0000</lastBuildDate>
<generator>http://www.sixapart.com/movabletype/?v=4.33-en</generator>
<docs>http://blogs.law.harvard.edu/tech/rss</docs> 


<item>
	<title>New BBC Comments Module: Technical Overview</title>
	<description><![CDATA[<p>I'm a developer of the Audience Publishing Services team in Programmes and On Demand in BBC Future Media. <a href="https://bbclatestnews.pages.dev/blogs/bbcinternet/2011/03/comments_module_rollout_to_all.html">As Jessica has explained </a>last week we rolled out a new comments product to all BBC blogs.</p>

<p>As a recent addition to the APS team I was tasked with revamping the commenting system and bringing it onto the BBC's Dynamic Web Application Platform (the Platform - PHP with BBC flavoured <a href="http://framework.zend.com/">Zend framework</a>).</p>

<p>The old system comprised of a set of <a href="http://en.wikipedia.org/wiki/Application_programming_interface">API</a>'s which would allow developers to interact with the APS backend system. This would allow them to retrieve a list of comments (we call it a comment forum), and post comments back to it.</p>

<div class="imgCaptionLeft" style="float: left; ">
<img alt="" src="https://bbclatestnews.pages.dev/blogs/bbcinternet/img/comment_editors_pick.jpg" width="240" height="116" class="mt-image-left" style="margin: 0 20px 5px 0;" /><p style="width:240px;font-size: 11px; color: rgb(102, 102, 102);"> </p></div>
<p>For ease of use, with products such as blogs, there was a set of SSI includes which would be embedded within a page which would pull in the necessary assets, forms etc and do all the API calls necessary to make it all work.</p>
<p>So why change?</p>
<p>The old architecture was basically a set of API's to the APS backend (which is tried &amp; trusted), but the frontend implementation was difficult to implement and was totally geared towards working on the older SSI based servers, not the Platform.</p>
<p>We needed an easy way of adding comments to pages on BBC Online which would work on the Platform, would be backwards compatible with the older servers, and one that would stand up to the high traffic demands of clients such as BBC News and BBC Sport.</p>
<p>So what did we do?</p>
<p>Firstly, whatever system we built, it had to interface with the APS API (our source of comments and comment forums). We needed something on the Platform which would act as a wrapper for these API calls, so we build the Comments Service. The Comments Service is the bridge between the Platform and APS. Functions are called on the Platform using the Comments Service, which in turn calls the relevant APS API calls, which then returns <a href="http://www.json.org/">JSON</a> back to the Comments Service, to return it back to the application which called it initially.</p>
<p>It's not unusual for us to see peak levels of traffic of up to 500 transactions a second for News pages using Comments, so the Comments Service makes use of <a href="http://memcached.org/">Memcached</a>, this enables us to cache the response from APS for a short while, to relieve pressure on the APS Service at times of heavy load.</p>
<div class="imgCaptionLeft" style="float: left; "><img class="mt-image-left" style="margin: 0 20px 5px 0;" src="https://bbclatestnews.pages.dev/blogs/bbcinternet/img/comments_module_cache.jpg" alt="Graphs showing caching of bbc comments module on 21st March 2011" width="595" height="442" />
<p>&nbsp;</p>
</div>

<p>An important thing to note in the diagram above (taken from our trial of Comments on BBC News Stories), is the scale of the y-axis for each of the graphs. Even though the requests per second from the Comments Module to the Comments Service peaks at nearly 120 requests/second (requests for a list of comments), the requests to the Comments Service to the APS Service never goes above 10 requests a second. This enables us to cope with the large spikes in traffic and scale the module to meet the demanding needs of the bbc.co.uk domain.</p>

<p>The next thing we needed was something to handle the presentation of comments, the forms needed to interact with comment forums (posting a comment) and deliver the assets and javascript to enable a rich user experience for the whole thing. This, is called the Comments Module.</p>

<p>The Comments Module is a small application, which follows the design pattern of the BBC Module (others BBC Modules include <a href="https://bbclatestnews.pages.dev/blogs/bbcinternet/barlesque/">Barlesque</a> - the masthead and footer on all BBC pages). This allows it to be included in any of our Platform pages with only a few lines of code. To include the Comments Module on the old <a href="http://httpd.apache.org/docs/1.3/howto/ssi.html#whataressi">SSI</a> based servers, we use the Comments Module as a full application, and call it via a dedicated URL using SSI. When the Comments Module is called in this way, it returns all the HTML, images and javascript needed to embed it into a page, so wherever the developer adds the SSI call to the URL of the Comments Module in their web page, the Comments Module will appear in all it's glory, already styled (in it's default appearance - which can be overridden with CSS), ready for use (including integration with our login system BBD iD).</p>

<p>The Comments Module uses the Comments Service to retrieve the comment forums from APS, and then renders them using the BBCs templating system - Spectrum. This takes care of rending the correct HTML, script, CSS tags etc.</p>

<p>So whats new in the new BBC Comments Module?</p>

<p>So, aside from a <a href="http://en.wikipedia.org/wiki/User_interface">UI </a>refresh (which at the moment is mainly visible on <a href="https://bbclatestnews.pages.dev/news/uk-12334486">BBC News</a>), we've added a few things which you might notice:</p>

<p><strong>Speed Bumping</strong></p>

<p>When this is enabled on a site, or comment forum, it enforces a minimum time interval between posts to the same comment forum by the same user. This is like a cooling off period between posts.</p>

<p><strong>Ajax Pagination</strong></p>

<p>When paginating between different pages of comments, if you have a javascript enabled browser with javascript turned on, all pagination happens using<a href="http://en.wikipedia.org/wiki/Ajax_(programming)"> Ajax</a>, making it load faster and increasing bandwidth efficiency.</p>

<p><strong>Ajax Comment Posting</strong></p>

<p>As with the Ajax pagination, posting comments can now occur using Ajax (specifically the BBC javascript framework<a href="https://bbclatestnews.pages.dev/glow/"> Glow</a>), meaning a faster response for users, and again a more efficient use of bandwidth.</p>

<div class="imgCaptionLeft" style="float: left; ">
<img alt="BBC comments highlighted" src="https://bbclatestnews.pages.dev/blogs/bbcinternet/img/highlight_comment.jpg" width="250" height="98" class="mt-image-left" style="margin: 0 20px 5px 0;" /><p style="width:250px;font-size: 11px; color: rgb(102, 102, 102);"></p></div>

<p><strong>Comment Highlighting</strong></p>

<p>We found the old way of linking to a comment could be confusing, as in a long list of comments, it wasn't always obvious which one had been linked to, so we've introduced highlighting for linked comments. See <a href="https://bbclatestnews.pages.dev/blogs/bbcinternet/2011/01/bbc_red_button_video_service_a.html?postId=105757666#comment_105757666">here</a> and <a href="https://bbclatestnews.pages.dev/news/uk-12334486?postId=105923512#comment_105923512">here</a>.</p>

<p><strong>Comments Per Page</strong></p>

<p>We've reduced the number of comments per page to 100 for all blogs (from 500). This reduces page size, which is better for bandwidth and page delivery times.</p>

<p><strong>HTML in Comments</strong></p>

<p>We allow a small set of tags to be used to style your comments on BBC Blogs. These are: &lt;blockquote&gt;, &lt;em&gt;, &lt;li&gt;, &lt;p&gt;, &lt;pre&gt;, &lt;q&gt;, &lt;strong&gt;, &lt;ul&gt;, &lt;ol&gt; and &lt;b&gt; These are not currently available for use on BBC News comments.</p>

<p>The Future</p>

<p>We've got a full roadmap for new features to be introduced in the coming months, i'm looking forward to telling you all about them, as we introduce them.</p>

<p>We're always interested to hear your thoughts, please use the comment box below!</p>

<p><em>Richard Summers is lead developer, User Publishing Services, Programmes and On Demand, BBC Future Media.</em></p>
]]>
</description>
         <dc:creator>Richard Summers 
Richard Summers
</dc:creator>
	<link>https://bbclatestnews.pages.dev/blogs/bbcinternet/2011/03/new_bbc_comments_module_-_tech.html</link>
	<guid>https://bbclatestnews.pages.dev/blogs/bbcinternet/2011/03/new_bbc_comments_module_-_tech.html</guid>
	<category>social</category>
	<pubDate>Mon, 28 Mar 2011 21:07:59 +0000</pubDate>
</item>


</channel>
</rss>

 
