<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Phil Leggetter - Real-Time Web Software and Technology Evangelist</title>
	
	<link>http://www.leggetter.co.uk</link>
	<description>Real-Time Web, Real-Time Data and Social Media Software and Technology Evangelist and Consultant</description>
	<lastBuildDate>Sun, 13 May 2012 04:00:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/PhilLeggettersBlog" /><feedburner:info uri="philleggettersblog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Realtime Commenting blog post on Smashing Magazine</title>
		<link>http://feedproxy.google.com/~r/PhilLeggettersBlog/~3/5I11rItxffQ/realtime-commenting-blog-post-on-smashing-magazine.html</link>
		<comments>http://www.leggetter.co.uk/2012/05/09/realtime-commenting-blog-post-on-smashing-magazine.html#comments</comments>
		<pubDate>Wed, 09 May 2012 13:51:50 +0000</pubDate>
		<dc:creator>Phil Leggetter</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[progressive enhancement]]></category>
		<category><![CDATA[pusher]]></category>
		<category><![CDATA[realtime web]]></category>
		<category><![CDATA[websockets]]></category>

		<guid isPermaLink="false">http://www.leggetter.co.uk/?p=23247</guid>
		<description><![CDATA[<p>Really pleased to see my <a href="http://coding.smashingmagazine.com/2012/05/09/building-real-time-commenting-system/">realtime commenting system blog post</a> appearing on <a href="http://coding.smashingmagazine.com">Smashing Magazine</a>. The post took a reasonable amount of time to write but I really like the way that the application is built from near-scratch and is progressively enhanced, first with AJAX and then realtime web functionality.</p> <p><a href="http://coding.smashingmagazine.com/2012/05/09/building-real-time-commenting-system/"></a><br /> Big [...]
Related posts:<ol>
<li><a href='http://www.leggetter.co.uk/2009/04/28/caplin-systems-blog-post-what-is-the-real-time-web.html' rel='bookmark' title='Caplin Systems Blog Post &#8211; What is the real-time web?'>Caplin Systems Blog Post &#8211; What is the real-time web?</a></li>
<li><a href='http://www.leggetter.co.uk/2012/01/24/hosted-realtime-services-making-the-realtime-web-more-accessible.html' rel='bookmark' title='Hosted realtime services &#8211; making the realtime web more accessible'>Hosted realtime services &#8211; making the realtime web more accessible</a></li>
<li><a href='http://www.leggetter.co.uk/2011/06/28/recent-article-in-net-magazine-websockets-code-a-real-time-survey.html' rel='bookmark' title='Recent article in .net magazine: WebSockets &#8211; Code a real-time survey'>Recent article in .net magazine: WebSockets &#8211; Code a real-time survey</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Really pleased to see my <a  href="http://coding.smashingmagazine.com/2012/05/09/building-real-time-commenting-system/">realtime commenting system blog post</a> appearing on <a  href="http://coding.smashingmagazine.com">Smashing Magazine</a>. The post took a reasonable amount of time to write but I really like the way that the application is built from near-scratch and is progressively enhanced, first with AJAX and then realtime web functionality.</p>
<p><a  href="http://coding.smashingmagazine.com/2012/05/09/building-real-time-commenting-system/"><img src="http://f.cl.ly/items/1L3v1O0m0n2J3L0G0x15/websockets_html5_pusher.png" /></a><br />
<small>Big thanks to <a  href="https://twitter.com/saulegoode">Bryce Wilson</a> of <a  href="http://zendit.com">zendit.com</a> for putting the HTML5, WebSockets (connectivity) and Pusher image together.</a></p>
<p>You can <a  href="http://coding.smashingmagazine.com/2012/05/09/building-real-time-commenting-system/">read the &quot;How To Build A Real-Time Commenting System&quot; post</a> on Smashing Magazine now. And here&#8217;s the tweet from <a  href="http://twitter.com/smashingmag">@smashingmag</a>:</p>
<blockquote class="twitter-tweet"><p>New on Smashing Coding: How To Build A Real-Time Commenting System &#8211; <a  href="http://t.co/cY3yZt2X" title="http://coding.smashingmagazine.com/2012/05/09/building-real-time-commenting-system/">coding.smashingmagazine.com/2012/05/09/bui…</a></p>
<p>&mdash; Smashing Magazine (@smashingmag) <a  href="https://twitter.com/smashingmag/status/200196453698764801" 0="data-datetime="2012-05-09T12:12:08+00:00"">May 9, 2012</a></p></blockquote>
<p><script src="//platform.twitter.com/widgets.js" charset="utf-8"></script></p>
<p>Related posts:<ol>
<li><a href='http://www.leggetter.co.uk/2009/04/28/caplin-systems-blog-post-what-is-the-real-time-web.html' rel='bookmark' title='Caplin Systems Blog Post &#8211; What is the real-time web?'>Caplin Systems Blog Post &#8211; What is the real-time web?</a></li>
<li><a href='http://www.leggetter.co.uk/2012/01/24/hosted-realtime-services-making-the-realtime-web-more-accessible.html' rel='bookmark' title='Hosted realtime services &#8211; making the realtime web more accessible'>Hosted realtime services &#8211; making the realtime web more accessible</a></li>
<li><a href='http://www.leggetter.co.uk/2011/06/28/recent-article-in-net-magazine-websockets-code-a-real-time-survey.html' rel='bookmark' title='Recent article in .net magazine: WebSockets &#8211; Code a real-time survey'>Recent article in .net magazine: WebSockets &#8211; Code a real-time survey</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.leggetter.co.uk/2012/05/09/realtime-commenting-blog-post-on-smashing-magazine.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.leggetter.co.uk/2012/05/09/realtime-commenting-blog-post-on-smashing-magazine.html</feedburner:origLink></item>
		<item>
		<title>WebSockets realise Comet. They’re not an alternative.</title>
		<link>http://feedproxy.google.com/~r/PhilLeggettersBlog/~3/3DzyzCRxIEk/websockets-realise-comet-theyre-not-an-alternative.html</link>
		<comments>http://www.leggetter.co.uk/2012/04/22/websockets-realise-comet-theyre-not-an-alternative.html#comments</comments>
		<pubDate>Sun, 22 Apr 2012 18:58:14 +0000</pubDate>
		<dc:creator>Phil Leggetter</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[api-fanboy]]></category>
		<category><![CDATA[comet]]></category>
		<category><![CDATA[Realime Push]]></category>
		<category><![CDATA[Realtime browser push]]></category>
		<category><![CDATA[realtime web]]></category>
		<category><![CDATA[websockets]]></category>

		<guid isPermaLink="false">http://www.leggetter.co.uk/?p=23220</guid>
		<description><![CDATA[<p> &#8220;WebSockets or Comet&#8221; </p> <p>I’ve been thinking about writing about this frequently used statement for a while, and I’ve seen a few comments and discussions previously about this e.g. from <a href="http://twitter.com/martintyler">Martin Tyler</a> of <a href="http://www.caplin.com">Caplin Systems</a> and Peter Lubbers of <a href="http://kaazing.com">Kaazing</a> in a <a href="http://www.infoq.com/articles/Web-Sockets-Proxy-Servers#view_54559">post on InfoQ</a>).</p> <p>Martin&#8217;s point of view is:</p> [...]
Related posts:<ol>
<li><a href='http://www.leggetter.co.uk/2011/08/25/what-came-before-websockets.html' rel='bookmark' title='What came before WebSockets?'>What came before WebSockets?</a></li>
<li><a href='http://www.leggetter.co.uk/2009/11/14/why-comet-is-key-to-the-truly-real-time-web.html' rel='bookmark' title='Why Comet is key to the Truly Real-Time Web'>Why Comet is key to the Truly Real-Time Web</a></li>
<li><a href='http://www.leggetter.co.uk/2011/09/07/qa-are-websockets-ready-for-commercial-use.html' rel='bookmark' title='Q&amp;A: Are WebSockets ready for commercial use?'>Q&#038;A: Are WebSockets ready for commercial use?</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<blockquote><p>
  &#8220;WebSockets or Comet&#8221;
</p></blockquote>
<p>I’ve been thinking about writing about this frequently used statement for a while, and I’ve seen a few comments and discussions previously about this e.g. from <a  href="http://twitter.com/martintyler">Martin Tyler</a> of <a  href="http://www.caplin.com">Caplin Systems</a> and Peter Lubbers of <a  href="http://kaazing.com">Kaazing</a> in a <a  href="http://www.infoq.com/articles/Web-Sockets-Proxy-Servers#view_54559">post on InfoQ</a>).</p>
<p>Martin&#8217;s point of view is:</p>
<blockquote><p>
  One thing I don&#8217;t understand is your stance on Comet. You seem to want to distance Kaazing from Comet, despite the fact that your WebSocket emulation is surely Comet. More than this though, WebSocket itself is also Comet since Comet is just a paradigm, not a any specific transport mechanism.
</p></blockquote>
<p>Peter&#8217;s opinion is:</p>
<blockquote><p>
  Comet is a programming model that allows a web server to push data to a browser. This is often achieved through a long-held HTTP request, but there really is no standard or specification for Comet; it is just an umbrella term for all the different ways that can be used to achieve this.</p>
<p>  WebSocket, on the other hand, is a well-defined API and protocol that allows for full-duplex, bidirectional communication (not just server push).
</p></blockquote>
<p>Can you really say WebSockets is an alternative to Comet when Comet servers use WebSockets?</p>
<p>My current thinking is the same as Martin&#8217;s (I did used to work with Martin). It is that:</p>
<p><strong>Comet is a paradigm, not only for server push but also for bi-directional communication.</strong></p>
<p>The need to do this with a web browser resulted in WebSockets – something which natively supported this in a way that HTTP did not. So, we have Comet to thank for WebSockets.</p>
<p>The <a  href="http://en.wikipedia.org/wiki/Comet_(programming)">Wikipedia Comet entry</a> states:</p>
<blockquote><p>
  Comet is a web application model in which a long-held HTTP request allows a web server to push data to a browser, without the browser explicitly requesting it. Comet is an umbrella term, encompassing multiple techniques for achieving this interaction.
</p></blockquote>
<p>Alex Russell’s <a  href="http://infrequently.org/2006/03/comet-low-latency-data-for-the-browser/">original Comet blog post</a> states:</p>
<blockquote><p>
  Fundamentally, they all use long-lived HTTP connections to reduce the latency with which messages are passed to the server.</p>
<p>  The architecture relies on a view of data which is event driven on both sides of the HTTP connection.
</p></blockquote>
<p>All very HTTP related. <strong>But</strong> the second quote interestingly says <strong>“event driven on both sides”</strong>. This bi-directional communication, backed up by the diagram from the web post (see below), seems to have been lost in the wikipedia entry.</p>
<p>
<figure>
  <img alt="Original Comet diagram by Alex Russell" src="http://infrequently.org/wp-content/Comet.png" /></p>
<figcaption>Original Comet diagram by Alex Russell. <small><a  href="http://infrequently.org/2006/03/comet-low-latency-data-for-the-browser/">source</a></small></figcaption>
</figure>
<p>What I’m suggesting is that Comet is a paradigm for realtime bi-directional communication between a server and a client. Initially it used long-lived HTTP connections in addition to a second short-lived connection for command requests (e.g. subscribe) <strong>because it was the only solution</strong>. Comet servers now use WebSockets because they are now available, are better than the HTTP-based alternatives and help Comet (the paradigm) be achieved and finally truly realised in a standardised way.</p>
<p>I’m suggesting that HTTP Long-Polling or HTTP-Streaming (all using XMLHttpRequest, Script tag polling, IFRAMES, ActiveX objects) and WebSockets are transfer technologies (Martin used the term &#8220;transfer mechanism&#8221;) that make the Comet paradigm possible.</p>
<p>I’m suggesting that saying “Comet or WebSockets” is an invalid statement and that the Wikipedia article is incorrect and that this diagram better reflects the relationship between WebSockets and Comet:</p>
<p>
<figure>
    <img alt="realtime web technology stack hierarchy" src="http://www.gliffy.com/pubdoc/2894748/L.png" /></p>
<figcaption>Realtime web technology stack hierarchy</figcaption>
</figure>
<p>I’m prepared to be wrong by being convinced otherwise. But I don&#8217;t think I am or will. Interested in hearing your opinions.</p>
<p><em>Note: I originally posted the core text to this as a <a  href="http://jfarcand.wordpress.com/2012/04/19/websockets-or-comet-or-both-whats-supported-in-the-java-ee-land/#comment-2271">comment</a> on a blog post <a  href="http://jfarcand.wordpress.com/2012/04/19/websockets-or-comet-or-both-whats-supported-in-the-java-ee-land/">&#8220;Websockets or Comet or Both? What’s supported in the Java EE land&#8221;</a></em></p>
<p>Related posts:<ol>
<li><a href='http://www.leggetter.co.uk/2011/08/25/what-came-before-websockets.html' rel='bookmark' title='What came before WebSockets?'>What came before WebSockets?</a></li>
<li><a href='http://www.leggetter.co.uk/2009/11/14/why-comet-is-key-to-the-truly-real-time-web.html' rel='bookmark' title='Why Comet is key to the Truly Real-Time Web'>Why Comet is key to the Truly Real-Time Web</a></li>
<li><a href='http://www.leggetter.co.uk/2011/09/07/qa-are-websockets-ready-for-commercial-use.html' rel='bookmark' title='Q&amp;A: Are WebSockets ready for commercial use?'>Q&#038;A: Are WebSockets ready for commercial use?</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.leggetter.co.uk/2012/04/22/websockets-realise-comet-theyre-not-an-alternative.html/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		<feedburner:origLink>http://www.leggetter.co.uk/2012/04/22/websockets-realise-comet-theyre-not-an-alternative.html</feedburner:origLink></item>
		<item>
		<title>Code Africa &amp; the Impact of Realtime</title>
		<link>http://feedproxy.google.com/~r/PhilLeggettersBlog/~3/Mt-wsMHmDks/code-africa-the-impact-of-realtime.html</link>
		<comments>http://www.leggetter.co.uk/2012/03/19/code-africa-the-impact-of-realtime.html#comments</comments>
		<pubDate>Mon, 19 Mar 2012 11:28:10 +0000</pubDate>
		<dc:creator>Phil Leggetter</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[api-fanboy]]></category>
		<category><![CDATA[codeafrica]]></category>
		<category><![CDATA[pusher]]></category>
		<category><![CDATA[realtime]]></category>
		<category><![CDATA[realtimeweb]]></category>
		<category><![CDATA[thetimes]]></category>
		<category><![CDATA[twilio]]></category>

		<guid isPermaLink="false">http://www.leggetter.co.uk/?p=22759</guid>
		<description><![CDATA[<p><br /> Over the weekend I attended the Code Africa hack weekend which was organised and hosted by <a href="http://www.thetimes.co.uk/">The Times</a>. The event saw developers, designers, journalists and entrepreneurs come together to try and form ideas and build prototypes over one weekend. My main takeaways from the event were a much better understanding of the [...]
Related posts:<ol>
<li><a href='http://www.leggetter.co.uk/2012/01/24/hosted-realtime-services-making-the-realtime-web-more-accessible.html' rel='bookmark' title='Hosted realtime services &#8211; making the realtime web more accessible'>Hosted realtime services &#8211; making the realtime web more accessible</a></li>
<li><a href='http://www.leggetter.co.uk/2012/02/09/edinburgh-techmeetup-web-browsers-the-realtime-web.html' rel='bookmark' title='Edinburgh Techmeetup, Web Browsers &amp; the Realtime Web'>Edinburgh Techmeetup, Web Browsers &#038; the Realtime Web</a></li>
<li><a href='http://www.leggetter.co.uk/2012/05/09/realtime-commenting-blog-post-on-smashing-magazine.html' rel='bookmark' title='Realtime Commenting blog post on Smashing Magazine'>Realtime Commenting blog post on Smashing Magazine</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img src="http://ebmedia.eventbrite.com/s3-s3/eventlogos/28569369/3090015319-1.jpg" alt="Code Africa logo" align="right" /><br />
Over the weekend I attended the Code Africa hack weekend which was organised and hosted by <a  href="http://www.thetimes.co.uk/">The Times</a>. The event saw developers, designers, journalists and entrepreneurs come together to try and form ideas and build prototypes over one weekend. My main takeaways from the event were a much better understanding of the state of technology in Africa, how technology can be used to help the people living within the continent and how <strong>realtime technologies can be used not only to improve application functionality, but also provide real impact</strong> in demonstrations and presentations.</p>
<h2>Ideas &amp; Prototypes</h2>
<h3>Simple SMS Education</h3>
<p>Using SMS and mobile to help deliver interactive, remote and continuous teaching &#8211; <a  href="http://www.twitter.com/danielbprobert">Daniel Probert</a>.</p>
<p><a  href="https://github.com/iliasbartolini/code-africa-education"><img src="http://simple-education-system.phpfogapp.com/images/logo.png" alt="Simple SMS Education logo" /></a></p>
<p><a  href="https://github.com/iliasbartolini/code-africa-education">See the code in github</a></p>
<h3>TransAfrik</h3>
<p>A number of ideas around crowd sourcing all sorts of information with an initial focus on travel; traffic, route planning and more.</p>
<p><img src="http://distilleryimage0.instagram.com/5a7ad14e712011e181bd12313817987b_7.jpg" alt="TransAfrik presentation" width="400" /></p>
<h3>Chircle</h3>
<p>A way of making a single charity payment and being able to distribute parts of that payment to multiple chosen charities &#8211; <a  href="http://twitter.com/setf">Stef Lewandowski</a></p>
<p><a  href="http://chircle.com"><img src="http://f.cl.ly/items/0e2A0p080x1D1n300f05/chircle_screen.png" width="400" /></a></p>
<p><a  href="http://chircle.com/">Visit Chircle.com and signup</a></p>
<h3>De-code Africa</h3>
<p>Build a fun way of discovering interesting facts and stats about Africa, and the countries within the content, and compare the information against other non-African countries.</p>
<p><a  href="http://thetimescodejam.appspot.com/"><img src="http://thetimescodejam.appspot.com/img/logo.png" width="400" /></a></p>
<p><a  href="http://thetimescodejam.appspot.com/">See the app in action</a></p>
<h2>The Pitch</h2>
<p>At the end of the second day each idea was given three minutes to pitch, and if possible demo. And today (Monday, March 19) they will be pitching to a group of 100 people including numerous company CEOs, at least two country presidents and a former Prime Minister at The Times CEO Summit Africa (<a  href="http://www.thetimes.co.uk/tto/public/ceo-summit-africa/?service=rss">RSS news feed</a>) &#8211; a real opportunity to potentially get funding and affect change.</p>
<p><img src="http://i.imgur.com/2yHgb.jpg" width="600" alt="ex-Prime Minister" /></p>
<h2>The Impact of Realtime</h2>
<p>Public speaking is quite new to me. In the past couple of years I&#8217;ve spoken at just a handful of events. However, over the past few weeks I&#8217;ve give more talks than ever about Realtime web technologies, including a lightening talk yesterday at CodeAfrica.</p>
<p>The more talks and workshops I give the more I realise that no amount of speaking will beat actually demonstrating a realtime web technology. But not only demonstrating, also using the technology to make the audience part of the presentation, and make it an interactive presentation which encourages discussion and stimulates ideas.</p>
<p>I saw this again yesterday when Daniel Probert, who lead the Simple SMS Education team which I was part of, demoed the prototype. As part of his three minute pitch Daniel used the prototype web app to send a question via SMS (thanks to <a  href="http://twilio.com">Twilio</a> to a number of people in the room. They then reply to that SMS with the answer to the question. These answers are instantly displayed within the prototype application (thanks to Twilio WebHooks and <a  href="http://pusher.com">Pusher</a>). This was described by one of the feedback panel as <em>&#8220;A killer demonstration&#8221;</em>.</p>
<p>The ability to instantly demonstrate interaction between multiple people using SMS and realtime web technologies has a real WOW-factor. I&#8217;ve used this sort of technology for over 10 years and I&#8217;m still excited and wowed by it!</p>
<h2>Final Thoughts &amp; Thanks</h2>
<p>CodeAfrica was organised and ran by <a  href="https://twitter.com/federicacocco">Federica Cocco</a>, <a  href="https://twitter.com/petermacrobert">Peter MacRobert</a> and <a  href="https://twitter.com/TomWhitwell">Tom Whitwell</a> and <a  href="https://twitter.com/xenophin">Xen Lategan</a> so they deserve a lot of credit for a great event and bringing so many interesting and creative people together.</p>
<p>It was also great to work with <a  href="https://twitter.com/anibe">Anibe Agamah</a>, <a  href="https://twitter.com/danielbprobert">Daniel Probert</a>, <a  href="https://twitter.com/tianjianfeng">Jianfeng Tian</a>, <a  href="https://twitter.com/iliasbartolini">Ilias Bartolini</a>, <a  href="https://twitter.com/andreiashu">Andrei Simion</a> and <a  href="https://twitter.com/SimonaCiocoiu">Simona Ciocoiu</a>.</p>
<p><img src="http://i54.twitgoo.com/1h8j91.jpg" width="600" alt="Simple SMS Education standup" /></p>
<p>With my core interest in technologies being realtime technologies I thought that the lack of Internet infrastructure (mobile data networks) in some areas of Africa was going to mean that I wouldn&#8217;t be able to use this technology over the weekend. However, it was used (and will be used today in Daniel&#8217;s pitch) to add real impact when demonstrating how technology can really make a difference.</p>
<p>Related posts:<ol>
<li><a href='http://www.leggetter.co.uk/2012/01/24/hosted-realtime-services-making-the-realtime-web-more-accessible.html' rel='bookmark' title='Hosted realtime services &#8211; making the realtime web more accessible'>Hosted realtime services &#8211; making the realtime web more accessible</a></li>
<li><a href='http://www.leggetter.co.uk/2012/02/09/edinburgh-techmeetup-web-browsers-the-realtime-web.html' rel='bookmark' title='Edinburgh Techmeetup, Web Browsers &amp; the Realtime Web'>Edinburgh Techmeetup, Web Browsers &#038; the Realtime Web</a></li>
<li><a href='http://www.leggetter.co.uk/2012/05/09/realtime-commenting-blog-post-on-smashing-magazine.html' rel='bookmark' title='Realtime Commenting blog post on Smashing Magazine'>Realtime Commenting blog post on Smashing Magazine</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.leggetter.co.uk/2012/03/19/code-africa-the-impact-of-realtime.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://www.leggetter.co.uk/2012/03/19/code-africa-the-impact-of-realtime.html</feedburner:origLink></item>
		<item>
		<title>jQuery UK 2012 Event – don’t always use jQuery</title>
		<link>http://feedproxy.google.com/~r/PhilLeggettersBlog/~3/vOshJyTC7z0/jquery-uk-2012-event-dont-always-use-jquery.html</link>
		<comments>http://www.leggetter.co.uk/2012/02/19/jquery-uk-2012-event-dont-always-use-jquery.html#comments</comments>
		<pubDate>Sun, 19 Feb 2012 07:27:48 +0000</pubDate>
		<dc:creator>Phil Leggetter</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[api-fanboy]]></category>
		<category><![CDATA[Event]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[jquk]]></category>

		<guid isPermaLink="false">http://www.leggetter.co.uk/?p=22726</guid>
		<description><![CDATA[<p>I started writing this right after the jQuery UK event but have only just found time to finish it off sitting in Stansted airport at 7am.</p> <p>jQuery is a funny thing; it&#8217;s made JavaScript coding easy for advanced developers and accessible to web designers, and you could even say that the web designer role has [...]
Related posts:<ol>
<li><a href='http://www.leggetter.co.uk/2009/01/31/drag-drop-bug-in-jquery-ui-153.html' rel='bookmark' title='Drag Drop bug in JQuery UI 1.5.3'>Drag Drop bug in JQuery UI 1.5.3</a></li>
<li><a href='http://www.leggetter.co.uk/2012/02/12/considerations-when-updating-the-dom-to-display-realtime-data.html' rel='bookmark' title='Considerations when updating the DOM to display realtime data'>Considerations when updating the DOM to display realtime data</a></li>
<li><a href='http://www.leggetter.co.uk/2011/03/23/looking-for-a-c-javascript-real-time-web-contractor.html' rel='bookmark' title='Looking for a C# (ASP.NET MVC), jQuery &amp; Real-Time Web Contractor'>Looking for a C# (ASP.NET MVC), jQuery &amp; Real-Time Web Contractor</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><em>I started writing this right after the jQuery UK event but have only just found time to finish it off sitting in Stansted airport at 7am.</em></p>
<p>jQuery is a funny thing; it&#8217;s made JavaScript coding easy for advanced developers and accessible to web designers, and you could even say that the web designer role has very much changed because of it. It&#8217;s made web interfaces much richer and interactive. But, it&#8217;s also made us lazy because it&#8217;s so easy to use. It&#8217;s time to take a step back and start thinking about best practices. And sometimes that might mean <em>not using</em> jQuery.</p>
<p>I was really pleased to hear <a  href="http://twitter.com/codepo8">Christian Heilmann</a>&#8216;s talk on moving back to using native methods, rather than always using jQuery (you can read Christian&#8217;s write-up and get see his slides <a  href="http://christianheilmann.com/2012/02/11/jquery-uk-conference-in-oxford-england-slides-audio-impressions-and-notes/">here</a>). His reasons for this were:</p>
<ul>
<li>To encourage education about native browser functionality</li>
<li>Native browser methods can perform better</li>
</ul>
<p>This latter point is of particular interest to me. Whilst at <a  href="http://www.caplin.com">Caplin Systems</a> I was part of a development team where performance was critical. We were (they still are) building realtime web libraries and UIs which need to deal with both high frequency of data updates and large data sets displayed within the UI. I met up with <a  href="http://twitter.com/fauna5">Rich Chamberlain</a>, Caplin&#8217;s dev manager, about a month ago and he reminded me of this. So, I set about comparing <code>document.getElementById('someId')</code> with <code>$('#someId')</code> and unsurprisingly the native method was by far superior.</p>
<p>For the results of this, and to test for yourself, see <a  href="http://www.leggetter.co.uk/2012/02/12/considerations-when-updating-the-dom-to-display-realtime-data.html">Considerations when updating the DOM to display realtime data</a>.</p>
<p>What was surprising was just how much better <code>document.getElementById</code> is. You would assume (I haven&#8217;t looked at the source) that within the <code>$</code> function that the selector would simply be checked:</p>
<pre><code>$ = function(selector) {
  if( isIdSelector(selector) ) {
    var el = document.getElementById(selector);
    return warpInJQueryStuff(el); // el could be null
  }
  // else …
};
</code></pre>
<p>Ok, it&#8217;s probably nothing like this. But you get the idea. So, what is it that makes using jQuery comparatively so expensive? My guess is that it&#8217;s the <code>warpInJQueryStuff</code>. One of the parts of jQuery that makes it so powerful (all those functions you can call after selecting elements, and the chaining functionality e.g.</p>
<pre><code>$('.something')
.doSomething()
.doSomethingElse()
.soOn();
</code></pre>
<p>The same goes when the <code>selector</code> isn&#8217;t just an <code>id</code> attribute selector i.e. a more advance CSS query.</p>
<pre><code>$ = function(selector) {
  if( isIdSelector(selector) ) {
    //...
  }
  else if( isQuerySelector(selector) ) {
    var els = document.querySelector(selector); //**TODO: check**
    return wrapInjQueryStuff(els);
  }
  // else …
};
</code></pre>
<p>The jQuery library shoots itself in the foot a little bit here because they&#8217;ve added non-CSS selectors (I can&#8217;t find an example right now but <a  href="http://www.google.co.uk/search?ix=teb&#038;sourceid=chrome&#038;ie=UTF-8&#038;q=jquery+non-standard+selectors#sclient=psy-ab&#038;hl=en&#038;safe=off&#038;source=hp&#038;q=jquery+%22non-standard+selectors%22&#038;pbx=1&#038;oq=jquery+%22non-standard+selectors%22&#038;aq=f&#038;aqi=&#038;aql=&#038;gs_sm=3&#038;gs_upl=3450l5414l0l5599l4l4l0l0l0l2l966l1518l5-1.1l2l0&#038;bav=on.2,or.r_gc.r_pw.r_cp.,cf.osb&#038;fp=a16cf6b4817c4ef9&#038;biw=1440&#038;bih=746&#038;ix=teb">a google</a> suggests this is correct). However, this isn&#8217;t anything that a <code>RegExp</code> couldn&#8217;t test for and if the jQuery-specific selectors aren&#8217;t found then the native function can be used. Again, maybe it&#8217;s the <code>wrapInjQueryStuff</code> that&#8217;s the problem?</p>
<p>Anyway, the point is: don&#8217;t always use jQuery. As with anything, consider what you are trying to achieve and if performance matters, or you just want to learn, use the native methods instead. But remember to check for <a  href="http://caniuse.com/queryselector">browser support</a>.</p>
<p>If performance matters and you find this type of thing interesting then Doug Neiner&#8217;s talk on <a  href="http://www.slideshare.net/dcneiner/contextual-jquery">Contextual jQuery</a> will probably interest you too.</p>
<p>Related posts:<ol>
<li><a href='http://www.leggetter.co.uk/2009/01/31/drag-drop-bug-in-jquery-ui-153.html' rel='bookmark' title='Drag Drop bug in JQuery UI 1.5.3'>Drag Drop bug in JQuery UI 1.5.3</a></li>
<li><a href='http://www.leggetter.co.uk/2012/02/12/considerations-when-updating-the-dom-to-display-realtime-data.html' rel='bookmark' title='Considerations when updating the DOM to display realtime data'>Considerations when updating the DOM to display realtime data</a></li>
<li><a href='http://www.leggetter.co.uk/2011/03/23/looking-for-a-c-javascript-real-time-web-contractor.html' rel='bookmark' title='Looking for a C# (ASP.NET MVC), jQuery &amp; Real-Time Web Contractor'>Looking for a C# (ASP.NET MVC), jQuery &amp; Real-Time Web Contractor</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.leggetter.co.uk/2012/02/19/jquery-uk-2012-event-dont-always-use-jquery.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://www.leggetter.co.uk/2012/02/19/jquery-uk-2012-event-dont-always-use-jquery.html</feedburner:origLink></item>
		<item>
		<title>Ideas for #APIHackathon</title>
		<link>http://feedproxy.google.com/~r/PhilLeggettersBlog/~3/teKGTrTNcBU/ideas-for-apihackathon.html</link>
		<comments>http://www.leggetter.co.uk/2012/02/18/ideas-for-apihackathon.html#comments</comments>
		<pubDate>Sat, 18 Feb 2012 11:33:40 +0000</pubDate>
		<dc:creator>Phil Leggetter</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[apihackathon]]></category>
		<category><![CDATA[Events]]></category>
		<category><![CDATA[realtime]]></category>

		<guid isPermaLink="false">http://www.leggetter.co.uk/?p=22721</guid>
		<description><![CDATA[<p>Realtime location tracking Poll (I&#8217;m sure they&#8217;ll introduce WebHooks soon) the Vodafone API and push realtime updates to a map.</p> <p>A better Betfair Ok, you probably won&#8217;t be able to build an app that&#8217;s better than betfair. But using our API in conjunction with Betfair you&#8217;ll be able to build a realtime betting system. The [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p><strong>Realtime location tracking</strong> Poll (I&#8217;m sure they&#8217;ll introduce WebHooks soon) the Vodafone API and push realtime updates to a map.</p>
<p><strong>A better Betfair</strong> Ok, you probably won&#8217;t be able to build an app that&#8217;s better than betfair. But  using our API in conjunction with Betfair you&#8217;ll be able to build a realtime betting system. The questions is: can you get realtime data from Betfair? Things like realtime odds?</p>
<p><strong>Multiplayer Hangman</strong> A simple turn-based game. Take the ideas that Dan from Pearson spoke about and use Pusher to push those results to multiple users.</p>
<p><strong>Realtime context sensitive advertising</strong> Advertising tends to be pretty static once an application loads. Why not analyse how a user is using an application and dynamically push different adverts to their app… using Pusher <img src='http://www.leggetter.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Any questions please give me a shout. I&#8217;m <a  href="http://twitter.com/leggetter">@leggetter</a> on Twitter.</p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.leggetter.co.uk/2012/02/18/ideas-for-apihackathon.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.leggetter.co.uk/2012/02/18/ideas-for-apihackathon.html</feedburner:origLink></item>
		<item>
		<title>Considerations when updating the DOM to display realtime data</title>
		<link>http://feedproxy.google.com/~r/PhilLeggettersBlog/~3/ZkByL9EHZNo/considerations-when-updating-the-dom-to-display-realtime-data.html</link>
		<comments>http://www.leggetter.co.uk/2012/02/12/considerations-when-updating-the-dom-to-display-realtime-data.html#comments</comments>
		<pubDate>Sun, 12 Feb 2012 15:18:26 +0000</pubDate>
		<dc:creator>Phil Leggetter</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[api-fanboy]]></category>

		<guid isPermaLink="false">http://www.leggetter.co.uk/?p=22632</guid>
		<description><![CDATA[<p>When data is being delivered to web applications the chances are that you&#8217;ll be displaying that data within the user interface (UI). In order to do this you need to find the element in the <a href="http://en.wikipedia.org/wiki/Document_Object_Model">Document Object Model</a> (DOM) and then update it. Whilst the performance of web browsers is improving all the time [...]
Related posts:<ol>
<li><a href='http://www.leggetter.co.uk/2012/02/19/jquery-uk-2012-event-dont-always-use-jquery.html' rel='bookmark' title='jQuery UK 2012 Event &#8211; don&#8217;t always use jQuery'>jQuery UK 2012 Event &#8211; don&#8217;t always use jQuery</a></li>
<li><a href='http://www.leggetter.co.uk/2012/01/24/hosted-realtime-services-making-the-realtime-web-more-accessible.html' rel='bookmark' title='Hosted realtime services &#8211; making the realtime web more accessible'>Hosted realtime services &#8211; making the realtime web more accessible</a></li>
<li><a href='http://www.leggetter.co.uk/2012/02/09/edinburgh-techmeetup-web-browsers-the-realtime-web.html' rel='bookmark' title='Edinburgh Techmeetup, Web Browsers &amp; the Realtime Web'>Edinburgh Techmeetup, Web Browsers &#038; the Realtime Web</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>When data is being delivered to web applications the chances are that you&#8217;ll be displaying that data within the user interface (UI). In order to do this you need to find the element in the <a  href="http://en.wikipedia.org/wiki/Document_Object_Model">Document Object Model</a> (DOM) and then update it. Whilst the performance of web browsers is improving all the time DOM manipulation can still be costly (use up time and resources) if you are pushing through a lot of data so it&#8217;s worth keeping the interaction with the DOM to a minimum. You should also consider how you access the DOM. Should you use a utility/library function or should you use native browser methods?
<br /></p>

<p>To demonstrate this, and show the considerations I&#8217;ve written a few small helper functions which can be called a number of times from tests and for each test I&#8217;ll time how long it takes to update the DOM a certain number of times.
<br /></p>

<p>For many web developers a script tag referencing in the jQuery library is one of the first elements to be added to any web page &#8211; it&#8217;s even in some web framework templates by default. So, a good first test is to time how long it takes for jQuery to update an element a number of times.
<br /></p>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

<pre data-code='testDefinitions_jQueryNoCache'></pre>

<script data-code-target="testDefinitions_jQueryNoCache" type="text/javascript">
var methods = {};
var elId = 'updateMe';

methods.jQueryNoCache = function(value) {
  jQuery('#' + elId).text(value);
};
</script>

<p>Now that we&#8217;ve defined one way of updating the DOM let&#8217;s add a way of caching a reference to the jQuery object that we create with the <code>jQuery(selector)</code> call. So, instead of having to make that call each time we can just access the object from a cache. This means that a new <code>jQuery</code> object doesn&#8217;t need to be created for every update.
<br /></p>

<pre data-code='testDefinitions_jQueryCache'></pre>

<script data-code-target="testDefinitions_jQueryCache">
var cache = {};
methods.jQueryCache = function(value) {
  if(!cache['#' + elId]) {
    cache['#' + elId] = jQuery('#' + elId);
  }
  cache['#' + elId].text(value);
};
</script>

<br />

<p>jQuery uses CSS selectors to find elements so rather than going directly to single elements using <code>id</code> attributes let&#8217;s also define a test that uses a nested selector: <code>div.top div.middle div.bottom p.update-me</code>.
<br /></p>

<pre data-code="testDefinitions_jQueryCSSSelectorNoCache"></pre>

<script data-code-target="testDefinitions_jQueryCSSSelectorNoCache">
var elCSSSelector = 'div.top div.middle div.bottom p.update-me';
methods.jQueryCSSSelectorNoCache = function(value) {
 jQuery(elCSSSelector).text(value);
};
</script>

<div class="top" style="width: 5px; height: 5px; overflow: hidden;">
  <div class="middle">
    <div class="bottom">
      <p class="update-me"></p>
    </div>
  </div>
</div>

<br />

<p>Finally, as a comparison let&#8217;s define functions which update the DOM by directly using the native <code>document.getElementById</code> and <code>document.querySelector</code> native browser functions, and both of these again using the caching technique we used earlier.
<br /></p>

<pre data-code='testDefinitions_byId'></pre>

<script data-code-target="testDefinitions_byId">
methods.byIdNoCache = function(value) {
  document.getElementById(elId).innerText = value;
};

methods.querySelectorNoCache = function(value) {
  document.querySelector(elCSSSelector).innerText = value;
};

methods.byIdCache = function(value) {
  if(!cache[elId]) {
    cache[elId] = document.getElementById(elId);
  }
  cache[elId].innerText = value;
};

methods.querySelectorCache = function(value) {
  if(!cache[elCSSSelector]) {
    cache[elCSSSelector] = document.querySelector(elCSSSelector);
  }
  cache[elId].innerText = value;
};
</script>

<p>If we execute each of these methods so that they are called 500 times to update the DOM and repeat that 10 times we see results as shown in the following graph.
<br /></p>

<figure>

<div id="timeSeriesChart"></div>

<p><figcaption style="font-size: 10px; padding-top: 5px;">Time in milliseconds (y-axis) it takes to update an element within the DOM <span id="updateMe"></span>(+1) times. The test is ran a number of times (x-axis)</figcaption>
</figure></p>

<p>And if we take each of the results and average them out we see the following:
<br /></p>

<figure>

<div id="avgSeriesChart"></div>

<p><figcaption style="font-size: 10px; padding-top: 5px;">The chart above shows the average time it takes to find the element and update the DOM using different techniques</figcaption>
</figure></p>

<aside style="width: 300px; float: right; background-color: #F8F8F8; border: 1px #CCC solid; padding: 1em; -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; font-size: 12px; margin-left: 20px; padding-bottom: 0;">

<fieldset>
  <legend><strong>Run DOM Manipulation Tests</strong></legend>
  <label for='numUpdates'>How many updates per test?</label>
  <input id="numUpdates" type="number" value="500" max="2500" required="required" /><small>(2500 max)</small><br />
  <label for="numLoops">How many times should each test be run?</label>
  <input id="numLoops" type="number" value="10" max="25" required="required" /><small>(25 max)</small><br />
  <button id="runTestsBtn">Run Tests</button>
</fieldset>

<p>If you&#8217;d like to try running the tests with different numbers you can do so using this form. When the tests complete the graphs will update. The numbers have been restricted in an effort to reduce the chances of your web browser hanging.
</aside>
<br /></p>

<script>
$(function() {
  $('#runTestsBtn').click(function() {
    var updates = $('#numUpdates').val();
    var loop = $('#numLoops').val();
    if(isNaN(updates) || isNaN(loop)) {
      return;
    }
    updates = Math.min(updates, 2500);
    loop = Math.min(loop, 25);
    runTests(updates, loop);
  });
})
</script>

<br />

<h3>Conclusion</h3>

The graphs are dynamically generated based on the browser viewing this blog post so the results will differ but even so the graphs suggest to following to me:

<ul>
<li>If you are sending a reasonable number of updates, and you are going to be updated the UI a lot, that you should be using <code>document.getElementById</code> to access and update the DOM.</li>
<li>If you want to use jQuery and the DOM structure isn&#8217;t going to update all that often then the caching references to jQuery objects is an efficient mechanism.</li>
<li>If you are are using CSS queries then the native <code>document.querySelector</code> performs better than <code>jQuery</code>. In both cases the complexity of the query is undoubtedly going to impact the performance.</li>
<li>Caching lookups of <code>document.querySelector</code> is a good idea since it improves performance.</li>
<li>Unsurprisingly direct <code>id</code> attributes lookups are fastest of all.</li>
<li><code>document.getElementById</code> is the fastest way of accessing the DOM and caching lookups doesn&#8217;t make a big difference.</li>
</ul>

The important thing is that you will know better than anybody else the sort of data that is going to be pushed into your app and it does with it. Balance performance and maintainability within your application and make decisions about how you are going to deal with updating the DOM based on that.

If your application gets infrequent updates then you&#8217;ll be fine using jQuery all the time. If your app gets a lot of realtime data streamed to it, maybe it&#8217;s a trading application, then you&#8217;ll need to fine-tune your app.

<p><script src="http://leggetter.github.com/script-cdn/jqplot/1.0.0b2/jquery.jqplot.min.js"></script>
<script src="http://leggetter.github.com/script-cdn/jqplot/1.0.0b2/plugins/jqplot.canvasTextRenderer.min.js"></script>
<script src="http://leggetter.github.com/script-cdn/jqplot/1.0.0b2/plugins/jqplot.canvasAxisTickRenderer.min.js"></script>
<script src="http://leggetter.github.com/script-cdn/jqplot/1.0.0b2/plugins/jqplot.canvasAxisLabelRenderer.min.js"></script>
<script src="http://leggetter.github.com/script-cdn/jqplot/1.0.0b2/plugins/jqplot.barRenderer.min.js"></script>
<script src="http://leggetter.github.com/script-cdn/jqplot/1.0.0b2/plugins/jqplot.categoryAxisRenderer.min.js"></script></p>

<link type="text/css" rel="stylesheet" href="http://leggetter.github.com/script-cdn/jqplot/1.0.0b2/jquery.jqplot.min.css" />

<script>
$(function() {
  var updates = 500;
  var loop = 10;
  runTests(updates, loop);
});

function clearChart() {
  $('#timeSeriesChart').html('');
  $('#avgSeriesChart').html('');
}

function runTests(updates, loop) {
  clearChart();
  
  function doTest(updateMethod) {
    var start = new Date();
    
    for(var i = 0; i < updates; ++i) {
      updateMethod(i);
    }
    
    var end = new Date();
    var took = (end - start);
    
    return took;
  }
  
  function log(msg) {
    //$(document.body).append('<div>' + msg + '</div>');
  }
  
  log('***');
  log('Starting test loop');
  
  var results = {};
  var took;
  for(var testName in methods) {
    if(!results[testName]) {
      results[testName] = [];
    }
    
    for(var j = 0; j < loop; ++j) {
      took = doTest(methods[testName]);
      results[testName].push(took);
    }
  }
  
  var timeSeries = [];
  var timeSeriesLabels = [];
  var averageSeries = [];
  var testResults;
  for(var ranTestName in results) {
    testResults = results[ranTestName];
    
    log('Ran ' + ranTestName + ' ' + loop + ' times with ' + updates + ' updates');
    log('Took: ' + testResults.join('ms, ') + 'ms');
    log('<br />');
    
    timeSeries.push(testResults);
    timeSeriesLabels.push(ranTestName);
    
    var total = 0;
    for(var i = 0, l = testResults.length; i < l; ++i) {
      total += testResults[i];
    }
    averageSeries.push((total/testResults.length));
  }
  
  var timeSeriesChart = $.jqplot ('timeSeriesChart', timeSeries, {legend: {show:true, labels:timeSeriesLabels}});
  
  var avgSeriesChart = $.jqplot('avgSeriesChart', [averageSeries], {
      seriesDefaults:{
          renderer:$.jqplot.BarRenderer,
          rendererOptions: {fillToZero: true}
      },
      series:timeSeriesLabels,
      axes: {
        xaxis: {
          tickRenderer: $.jqplot.CanvasAxisTickRenderer ,
          tickOptions: {
            fontFamily: 'Georgia',
            fontSize: '10pt',
            angle: -30
          },
          renderer: $.jqplot.CategoryAxisRenderer,
          ticks: timeSeriesLabels
        }
      }
  });
}
</script>

<script src="http://leggetter.github.com/script-cdn/blog_helpers/js/script-to-html.js"></script>

<script>
$(function() {
  $.scriptToHtml();
});
</script>

<p><style type="text/css">
.jqplot-table-legend { width: auto !important; }
.jqplot-table-legend td { text-align: left !important; }
</style></p>
<p>Related posts:<ol>
<li><a href='http://www.leggetter.co.uk/2012/02/19/jquery-uk-2012-event-dont-always-use-jquery.html' rel='bookmark' title='jQuery UK 2012 Event &#8211; don&#8217;t always use jQuery'>jQuery UK 2012 Event &#8211; don&#8217;t always use jQuery</a></li>
<li><a href='http://www.leggetter.co.uk/2012/01/24/hosted-realtime-services-making-the-realtime-web-more-accessible.html' rel='bookmark' title='Hosted realtime services &#8211; making the realtime web more accessible'>Hosted realtime services &#8211; making the realtime web more accessible</a></li>
<li><a href='http://www.leggetter.co.uk/2012/02/09/edinburgh-techmeetup-web-browsers-the-realtime-web.html' rel='bookmark' title='Edinburgh Techmeetup, Web Browsers &amp; the Realtime Web'>Edinburgh Techmeetup, Web Browsers &#038; the Realtime Web</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.leggetter.co.uk/2012/02/12/considerations-when-updating-the-dom-to-display-realtime-data.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.leggetter.co.uk/2012/02/12/considerations-when-updating-the-dom-to-display-realtime-data.html</feedburner:origLink></item>
		<item>
		<title>Edinburgh Techmeetup, Web Browsers &amp; the Realtime Web</title>
		<link>http://feedproxy.google.com/~r/PhilLeggettersBlog/~3/KYCdXHB8zAg/edinburgh-techmeetup-web-browsers-the-realtime-web.html</link>
		<comments>http://www.leggetter.co.uk/2012/02/09/edinburgh-techmeetup-web-browsers-the-realtime-web.html#comments</comments>
		<pubDate>Thu, 09 Feb 2012 10:48:33 +0000</pubDate>
		<dc:creator>Phil Leggetter</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[api-fanboy]]></category>
		<category><![CDATA[pusher]]></category>
		<category><![CDATA[realtime web]]></category>
		<category><![CDATA[SPDY]]></category>
		<category><![CDATA[web browsers]]></category>
		<category><![CDATA[websockets]]></category>

		<guid isPermaLink="false">http://www.leggetter.co.uk/?p=22601</guid>
		<description><![CDATA[I gave a presentation yesterday at Edinburgh <a href="http://techmeetup.co.uk/">techmeetup</a>. A big thanks to <a href="https://twitter.com/daleharvey">Dale Harvey</a> for inviting me to talk and to all the attendees for taking the time to attend, listen and interact. <a href="http://twitter.com/aaronbassett">Aaron Bassett</a> also gave a good talk on Avoiding Integration Hell so I&#8217;d recommend you follow him for more [...]
Related posts:<ol>
<li><a href='http://www.leggetter.co.uk/2012/01/24/hosted-realtime-services-making-the-realtime-web-more-accessible.html' rel='bookmark' title='Hosted realtime services &#8211; making the realtime web more accessible'>Hosted realtime services &#8211; making the realtime web more accessible</a></li>
<li><a href='http://www.leggetter.co.uk/2012/05/09/realtime-commenting-blog-post-on-smashing-magazine.html' rel='bookmark' title='Realtime Commenting blog post on Smashing Magazine'>Realtime Commenting blog post on Smashing Magazine</a></li>
<li><a href='http://www.leggetter.co.uk/2012/03/19/code-africa-the-impact-of-realtime.html' rel='bookmark' title='Code Africa &amp; the Impact of Realtime'>Code Africa &#038; the Impact of Realtime</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[I gave a presentation yesterday at Edinburgh <a  href="http://techmeetup.co.uk/">techmeetup</a>. A big thanks to <a  href="https://twitter.com/daleharvey">Dale Harvey</a> for inviting me to talk and to all the attendees for taking the time to attend, listen and interact. <a  href="http://twitter.com/aaronbassett">Aaron Bassett</a> also gave a good talk on Avoiding Integration Hell so I&#8217;d recommend you follow him for more info.

<p>Here&#8217;s a direct link to the <a  href="http://www.leggetter.co.uk/pres/techmeetup_edi_2012-02-08/">&#8220;Web Browsers &amp; the Realtime Web 
the past, present &amp; future&#8221; slides</a>.</p>

And here&#8217;s the recording of my talk (thanks to <a  href="http://twitter.com/MariusCiocanel">Marius Ciocanel</a>):

<iframe src="http://player.vimeo.com/video/36602961?title=0&amp;byline=0&amp;portrait=0" width="100%" height="400" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>

<a  href="http://vimeo.com/36602961">TechMeetup Talks &#8211; Phil @Leggetter on the past present and future of the Realtime web</a> from <a  href="http://vimeo.com/techmeetup">TechMeetup</a> on <a  href="http://vimeo.com">Vimeo</a>.

After the presentation there were a number of good questions asked here they are, and my answers. If you&#8217;ve any other questions please <a href="mailto:phil@leggetter.co.uk?subject=Web Browsers &#038; the Realtime Web Qs">drop me an email</a> or leave a comment.

<h3>Does WebSockets provide support for common use cases? Does it natively support Pub/Sub?</h3>

As with most standardised technology WebSockets offer the very basics of what is required to enable realtime bi-directional communication between a server and a client;

<ul>
<li><code>var ws = new WebSocket(url)</code> &#8211; connect</li>
<li><code>ws.onopen = function() {};</code> &#8211; connected</li>
<li><code>ws.onmessage = function(ev) {};</code> &#8211; some data has arrived</li>
<li><code>ws.send({"some":"data"});</code> &#8211; send some data to the server</li>
<li><code>ws.onclose = function() {};</code> &#8211; the connection has closed</li>
<li><code>ws.close();</code> &#8211; close the connection</li>
</ul>

If you want functionality like auto reconnection, connection stability checking (<a  href="http://www.whatwg.org/specs/web-apps/current-work/multipage/network.html#ping-and-pong-frames">ping/pong is hopefully coming</a>), the ability to subscribe to channels/topics/subjects in order to filter and partition data then you need to build this functionality yourself or user a client/server combination that already offers this. We&#8217;ve built this functionality into our Pusher JavaScript library and service.

<h3>How do people on shared hosting use this technology?</h3>

If you are on a shared hosting then the hosting provide doesn&#8217;t tend to like this sort of technology because it requires you to maintain persistent connections between the hosting server and the client. I don&#8217;t know for sure but I think PHP hosting services may do something to stop this sort of thing from working. However, I&#8217;m pretty sure that hosting services like <a  href="http://www.joyent.com/">Joyent</a> will provide support since <a  href="http://socket.io">socket.io</a> is quite possibly one of the most popular packages available. I could be wrong, but I&#8217;d be surprised if I am. If you know, please get in touch.

A great option here is to use <a  href="http://pusher.com">Pusher</a> since it remove the need to maintain the persistent connections &#8211; it&#8217;s technology agnostic.

<h3>Do WebSockets have problems with proxies and firewalls?</h3>

Yes, but connecting over a secure connection (WSS:// over port 443) will work in the majority of cases. For those cases it doesn&#8217;t work I&#8217;ve seen HTTP Long-Polling and HTTP Streaming also having problems where proxies and firewalls don&#8217;t like the long-held requests. It&#8217;s really a battle between realtime technologies and older Internet infrastructure.

<h3>Where does SPDY fit into the Realtime Web?</h3>

&#8220;<a  href="http://www.chromium.org/spdy/spdy-whitepaper">SPDY is an experimental protocol for a faster web</a>&#8220;. It&#8217;s actually used by Google Chrome and a number of Google web apps already (a quick Google suggestions <a  href="http://www.datamation.com/open-source/firefox-11-gets-spdy.html">Firefox 11 will support SPDY</a>). The main problem is that in order for this protocol to be used we need the Internet Infrastructure to upgrade. This isn&#8217;t going to happen to quickly. So, SPDY sounds very promising but it&#8217;ll be a while until we see it widely adopted/used.

It&#8217;s easier to move client technology forward (we need IE to auto update), but server technology looks like it&#8217;ll be slower to move forward.

I recommend keeping an eye on <a  href="http://www.igvita.com/2011/04/07/life-beyond-http-11-googles-spdy/">Ilya Grigorik&#8217;s blog</a> for related tech info.

Please let me know if I&#8217;ve missed any questions (I&#8217;m sure I have) or if you have any further questions by [dropping me an email](mailto:phil@leggetter.co.uk?subject=Web Browsers &amp; the Realtime Web Qs) or leaving a comment
<p>Related posts:<ol>
<li><a href='http://www.leggetter.co.uk/2012/01/24/hosted-realtime-services-making-the-realtime-web-more-accessible.html' rel='bookmark' title='Hosted realtime services &#8211; making the realtime web more accessible'>Hosted realtime services &#8211; making the realtime web more accessible</a></li>
<li><a href='http://www.leggetter.co.uk/2012/05/09/realtime-commenting-blog-post-on-smashing-magazine.html' rel='bookmark' title='Realtime Commenting blog post on Smashing Magazine'>Realtime Commenting blog post on Smashing Magazine</a></li>
<li><a href='http://www.leggetter.co.uk/2012/03/19/code-africa-the-impact-of-realtime.html' rel='bookmark' title='Code Africa &amp; the Impact of Realtime'>Code Africa &#038; the Impact of Realtime</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.leggetter.co.uk/2012/02/09/edinburgh-techmeetup-web-browsers-the-realtime-web.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.leggetter.co.uk/2012/02/09/edinburgh-techmeetup-web-browsers-the-realtime-web.html</feedburner:origLink></item>
		<item>
		<title>Hosted realtime services – making the realtime web more accessible</title>
		<link>http://feedproxy.google.com/~r/PhilLeggettersBlog/~3/JLiriPS_040/hosted-realtime-services-making-the-realtime-web-more-accessible.html</link>
		<comments>http://www.leggetter.co.uk/2012/01/24/hosted-realtime-services-making-the-realtime-web-more-accessible.html#comments</comments>
		<pubDate>Tue, 24 Jan 2012 09:05:11 +0000</pubDate>
		<dc:creator>Phil Leggetter</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[api-fanboy]]></category>
		<category><![CDATA[pusher]]></category>
		<category><![CDATA[real-time web]]></category>
		<category><![CDATA[realtime hosted services]]></category>
		<category><![CDATA[self-hosted realtime services]]></category>
		<category><![CDATA[socket.io]]></category>
		<category><![CDATA[websockets]]></category>

		<guid isPermaLink="false">http://www.leggetter.co.uk/?p=22151</guid>
		<description><![CDATA[The real-time web started off by just being &#8220;cool&#8221;; a quirky and fun space to be in with lots of &#8220;cool&#8221; technology. People weren&#8217;t sure whether it was just a fad, stimulated by hype. The value it delivers in the form of customer engagement, interaction, collaboration and the opportunities it can provide by being real-time [...]
Related posts:<ol>
<li><a href='http://www.leggetter.co.uk/2012/02/09/edinburgh-techmeetup-web-browsers-the-realtime-web.html' rel='bookmark' title='Edinburgh Techmeetup, Web Browsers &amp; the Realtime Web'>Edinburgh Techmeetup, Web Browsers &#038; the Realtime Web</a></li>
<li><a href='http://www.leggetter.co.uk/2012/03/19/code-africa-the-impact-of-realtime.html' rel='bookmark' title='Code Africa &amp; the Impact of Realtime'>Code Africa &#038; the Impact of Realtime</a></li>
<li><a href='http://www.leggetter.co.uk/2012/05/09/realtime-commenting-blog-post-on-smashing-magazine.html' rel='bookmark' title='Realtime Commenting blog post on Smashing Magazine'>Realtime Commenting blog post on Smashing Magazine</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[The <strong>real-time web</strong> started off by just being &#8220;cool&#8221;; a quirky and fun space to be in with lots of &#8220;cool&#8221; technology. People weren&#8217;t sure whether it was just a fad, stimulated by hype. The value it delivers in the form of customer engagement, interaction, collaboration and the opportunities it can provide by being real-time is now much clearer, and consequently the benefits of using real-time technologies are beginning to be understood.

<h2>Realtime Web Technology Accessibility</h2>

One of the problems with real-time technologies over the past 10+ years has been the accessibility. Comet servers were difficult to install, a pain to maintain and upgrade and generally difficult to use due to numerous configuration options and technology quirks, mainly exposed by different web browsers. There have been a number of very important changes have happened over the past few years that now make real-time technologies much more accessible.

<h3>Web Browser Wars</h3>

For such a long time Internet Explorer 6 was by far the best web browser available. It&#8217;s the reason that Microsoft &#8220;dropped the ball&#8221; and why Firefox and Chrome are where they are today. But now we are in a great position of having a number of actively developed web browsers being driven by real competition to offer the best browsing experience. This has lead to a general improvements in browser speed (JavaScript and rendering engines) but also improvements in web technology available to web browsers and, possibly most important of all, web standardisation. <strong>HTML5 does indeed rock!</strong>

<h3>Cloud Hosted Services</h3>

Cloud hosted services, frequently referred to as Infrastructure as a Service (IaaS). These hosted solutions take away the pain of installation, maintenance and scaling, and frequently deliver them at a fraction of the cost possible if you were self-hosting.

<h3>Better self hosted solutions</h3>

Cloud hosted services are awesome (I would say that, but they are!) but the <a  href="http://www.leggetter.co.uk/real-time-web-technologies-guide#self-hosted">self hosted realtime web solutions</a> that are available and the ease of installation has massively improved. As an example, you can have a <a  href="http://socket.io">socket.io</a> example page up and running on node.js within minutes. These improvements have been driven by an increased demand for

<h3>WebSockets</h3>

WebSockets is a standard for continuous bi-directional single-connection communication between client and server. Real-time technologies, and in particular real-time messaging within a web browser, has been possible before but not until WebSockets has there been a standard that is so likely to succeed.

Unfortunately WebSockets don&#8217;t mean that the pain has completely gone away. The technology, whilst more accessible, still isn&#8217;t as easy as it could be for developers to use. On some platforms WebSocket server installation can still take too long, maintenance is just something developers don&#8217;t really want to do, and scaling takes time, effort and lots of configuration. So, we turn to the first important change as a solution to this problem &#8211; hosted realtime services.

<h2>Hosted realtime services</h2>

Hosted realtime services, like <a  href="http://pusher.com">Pusher</a> who I work for, make it much faster and easier for developers to start adding real-time functionality (push notifications, activity streams, realtime chat, collaboration, realtime data visualisations, multiplayer games, 2nd screen/Social TV experiences etc.) to their applications within minutes. For bigger organisations, the same solution also means that you know your developers are busy adding value, not installing, configuring and maintaining. This means they are happy and productive.

The web is only around 20 years old and the real-time web is younger still. We don&#8217;t know exactly where the next few years will take the web but I&#8217;m sure that HTML5, WebSockets and real-time messaging will be a key component, and services like Pusher in a great position to help provide the infrastructure that developers need to easily use these technologies.

<h2>Where next?</h2>

<ul>
<li>If you found this interesting you might find my <a  href="http://www.leggetter.co.uk/real-time-web-technologies-guide">Realtime Web Technology Guide/List</a> of interest. If you know of any technologies that I&#8217;ve missed, please <a  href="/contact-me">get in touch</a>.</li>
<li>Why not take a look at <a  href="http://pusher.com">Pusher</a> and the <a  href="http://blog.pusher.com">Pusher Blog</a></li>
</ul>
<p>Related posts:<ol>
<li><a href='http://www.leggetter.co.uk/2012/02/09/edinburgh-techmeetup-web-browsers-the-realtime-web.html' rel='bookmark' title='Edinburgh Techmeetup, Web Browsers &amp; the Realtime Web'>Edinburgh Techmeetup, Web Browsers &#038; the Realtime Web</a></li>
<li><a href='http://www.leggetter.co.uk/2012/03/19/code-africa-the-impact-of-realtime.html' rel='bookmark' title='Code Africa &amp; the Impact of Realtime'>Code Africa &#038; the Impact of Realtime</a></li>
<li><a href='http://www.leggetter.co.uk/2012/05/09/realtime-commenting-blog-post-on-smashing-magazine.html' rel='bookmark' title='Realtime Commenting blog post on Smashing Magazine'>Realtime Commenting blog post on Smashing Magazine</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.leggetter.co.uk/2012/01/24/hosted-realtime-services-making-the-realtime-web-more-accessible.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.leggetter.co.uk/2012/01/24/hosted-realtime-services-making-the-realtime-web-more-accessible.html</feedburner:origLink></item>
		<item>
		<title>The Right Place At The Right Time: How The Real-Time Web Influences The “local” World</title>
		<link>http://feedproxy.google.com/~r/PhilLeggettersBlog/~3/fh_M67bdZPQ/the-right-place-at-the-right-time-how-the-real-time-web-influences-the-local-world.html</link>
		<comments>http://www.leggetter.co.uk/2011/11/09/the-right-place-at-the-right-time-how-the-real-time-web-influences-the-local-world.html#comments</comments>
		<pubDate>Wed, 09 Nov 2011 17:09:37 +0000</pubDate>
		<dc:creator>Phil Leggetter</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[thoughts]]></category>
		<category><![CDATA[Local Social Summit]]></category>
		<category><![CDATA[pusher]]></category>
		<category><![CDATA[Social]]></category>

		<guid isPermaLink="false">http://www.leggetter.co.uk/?p=22012</guid>
		<description><![CDATA[A couple of hours ago I was on a on the &#8216;The Right Place At The Right Time: How The Real-Time Web Influences The &#8220;local&#8221; World&#8217; panel at the <a href="http://www.localsocialsummit.com/">Local Social Summit</a>. The panel was organised and chaired by <a href="http://twitter.com/#!/sebprovencher">Sebastien Provencher</a> and also included <a href="http://twitter.com/#!/ryanmacjones">RyanMacJones</a>, <a href="http://twitter.com/#!/daveambrose">Dave Ambrose</a> and <a href="http://twitter.com/#!/daveambrose">Stefano Diemmi</a>. [...]
Related posts:<ol>
<li><a href='http://www.leggetter.co.uk/2010/06/11/kwwika-world-cup-2010-real-time-push-web-app-apple-ipad-competition.html' rel='bookmark' title='Kwwika World Cup 2010 Real-Time Push Web App &#8211; Apple iPad competition'>Kwwika World Cup 2010 Real-Time Push Web App &#8211; Apple iPad competition</a></li>
<li><a href='http://www.leggetter.co.uk/2010/08/27/google-realtime-search-isnt-real-time.html' rel='bookmark' title='Google realtime search isn&#8217;t real-time'>Google realtime search isn&#8217;t real-time</a></li>
<li><a href='http://www.leggetter.co.uk/2011/06/28/recent-article-in-net-magazine-websockets-code-a-real-time-survey.html' rel='bookmark' title='Recent article in .net magazine: WebSockets &#8211; Code a real-time survey'>Recent article in .net magazine: WebSockets &#8211; Code a real-time survey</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[A couple of hours ago I was on a on the &#8216;The Right Place At The Right Time: How The Real-Time Web Influences The &#8220;local&#8221; World&#8217; panel at the <a  href="http://www.localsocialsummit.com/">Local Social Summit</a>. The panel was organised and chaired by <a  href="http://twitter.com/#!/sebprovencher">Sebastien Provencher</a> and also included <a  href="http://twitter.com/#!/ryanmacjones">RyanMacJones</a>, <a  href="http://twitter.com/#!/daveambrose">Dave Ambrose</a> and <a  href="http://twitter.com/#!/daveambrose">Stefano Diemmi</a>.

Here&#8217;s the information about the panel and my thoughts on the questions that were asked.

<h2>Description</h2>

The rise of the real-time Web is well documented. Propelled by both the social networking revolution and mobile device ubiquitousness, we&#8217;re seeing the birth of new user services and business opportunities. In this panel,  we will explore the time element in the local/social Web and will try to discover what kind of content works well in real-time, what are the benefits for consumers and what kind of business models can be deployed to leverage the &#8220;time&#8221; dimension.

<h2>Questions</h2>

<h3>Introduce yourself, describe your business</h3>

<p><a  href="http://twitter.com/leggetter">Phil Leggetter</a>
Developer Evangelist at <a  href="http://pusher.com">Pusher</a>
Pusher is a cloud hosted service and API that makes it really easy to add cool realtime user engaging functionality, like push notifications, activity streams and chat, to any Web, Mobile, Tablet or Desktop application.</p>

<h3>How do you define the real-time Web? What is the importance of the time dimension on the Web today?</h3>

Firstly I think we need to define &#8216;realtime&#8217;. Realtime means that when information is generated following an event of some kind, that information must be available and received in a timely manner so that the context of that information is not lost; so that the information is still relevant and usable.

The realtime web, made popular by Twitter and the instant availability of information, takes this concept of timely information to the web. To me &#8216;the realtime web&#8217; means that instant availability of information but also the instant distribution of that information. It means that those that have registered an interest in a pieces of information will have it pushed to them. It also means we now have the technology available for realtime (timely) bi-directional communication making realtime chat and collaboration using the Internet as the network something that is truly achievable.

<h3>How does the time dimension expresses itself in your business? or in the local/social universe, social media, daily deals, etc. (feel free to comment/provide examples outside of your business as well)</h3>

At a fundamental level Pusher is an Internet realtime messaging service. We aim to keep latency, the time between a message being sent and it being received, as low as possible so it&#8217;s a core part of our service. The value in realtime is the <strong>opportunity</strong> that receiving information as quickly as possible presents.

The technology behind this comes from a trading background where milliseconds can mean getting the best price and can make the difference between getting a great price for a commodity/stock/share or a bad one. This results in potentially millions of pounds.

Realtime in local and social also results in opportunity. The first to hear about and respond to a deal benefits. Those who are aware of the unexpected U2 concert on a near-by roof top have the opportunity to get there in time to see this one-off event. People aware of a terror threat or some other kind of emergency can act accordingly &#8211; either get the hell out of the area or head to it to cover the event or help out. It&#8217;s all about the opportunity that getting timely data presents.

<h3>What kind of content works well in real-time Web? Are there business categories that work better?</h3>

Traditionally realtime web technologies have been used in finance because that&#8217;s where the benefits have been greatest. This means that the content has been pricing information about stocks and shares along with news related to finance.

But with both realtime technology and realtime data much more accessible we are seeing other businesses using and benefiting from it. Sports and betting data is the most obvious second step for this technology. Auctions are a good use and again this is really money driven. Then there&#8217;s business categories where people just want to get the information as soon as possible. News, sport scores, disaster warning systems, disaster relief and short lived deals are examples. Then there&#8217;s information around systems that allow for realtime collaboration; where people are working together to discuss and solve problems. Chat is the first obvious example but synchronised document editing is another more complex, yet highly beneficial one.

Twitter demonstrates a form of chat but it&#8217;s only really good for broadcasting information and for one-to-one chat. If you want a multi-user experience you need to take the conversation away from Twitter. Google hangouts or apps such as <a  href="http://blether.co">!blether</a> and <a  href="http://nurph.com">Nurph</a> are great for that.

<h3>What is the role of “mobile” in this evolution?</h3>

We&#8217;re seeing a lot of notification platforms for mobile, but that means the data is going just one way. In some cases this is all that&#8217;s needed e.g. &#8220;Daily Deal X available at Y&#8221;. But for collaborative applications you need more than just a notification infrastructure. For that we needs better mobile data infrastructure. In London it&#8217;s fine but where I live in Scotland it&#8217;s nearly non-existent. So, mobile and local is going to benefit a lot of people but not everybody. Also, mobile data plans need to be revamped to take into account we are becoming more data, and less voice focused.

<h3>What are the benefits for consumers? emergency/Short-term need vs. long term need. Real-time local news (Japan tsunami, London riots, hashtags, etc.)</h3>

I think we&#8217;ve already covered this. It&#8217;s about the opportunity that getting realtime information brings. To know something is going on and get to or away from somewhere as quickly as possible.

<h3>What are the business models (new or not) that emerge when we add the time dimension? Yield management /last-minute: real or hype? Is this real? Groupon Now disappointing?</h3>

There&#8217;s an excitement generated by having a time constraint. So I think in general we&#8217;ll see some fun ideas come out of this. I&#8217;m particularly excited to see some <strong>2nd Screen</strong> applications that synchronise with live events or scheduled TV programmes. There&#8217;s an opportunity to add a lot more context and fun to TV beyond what we are watching and I&#8217;ve yet to see a really great example. I&#8217;m not a betting guy so I&#8217;ve not tried out <a  href="https://picklive.com/">PickLive</a> but for this interested in Football and Fantasy Football I&#8217;m sure it&#8217;s a great experience. I want to see more in this space.

What&#8217;s the business model? Probably synchronised contextual advertising and also increased user engagement in a programme, and TV figures mean more advertising revenue.

<h3>Are there technologies/technology stacks that are core to real-time? How do we implement real-time technologies?</h3>

Adding realtime functionality to an application is now easier than it&#8217;s ever been. In the past few years the technologies allowing realtime communication have improved and are much more accessible. Scaling and maintain such technology stacks can still be a problem which is one of the features that Pusher offers.

For a true realtime experience the best technology in my opinion is <a  href="http://pusher.com/websockets">WebSockets</a>. They allow for low latency true bi-directional communication over the Internet. There are other HTTP-based techniques but they suffer from the overhead inherent in HTTP such as the additional load of HTTP Headers sent with each HTTP request. Browser techniques which do work have to be implemented in different ways in different web browsers. The standardised approach being taken with WebSockets means that it will become the best way of implementing realtime server to client bi-directional communication.

Technologies worth a mention include:

<ul>
<li><a  href="http://pusher.com">Pusher</a>: a hosted realtime service with APIs that make it really easy to add realtime user engaging functionality to a web, mobile, tablet or desktop app. Have I already said that? <img src='http://www.leggetter.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
<li><a  href="http://code.google.com/p/pubsubhubbub/">PubSubHubbub</a>: provides a way to subscribe to RSS feeds so that new content is instantly pushed to you as soon as it&#8217;s available. It&#8217;s a server to server technology and has been used more recently to let you subscribe to any arbitrary data, not just RSS. <a  href="http://nodejs.org/">Node.js</a> is big in the tech community because JavaScript is generally big on the Web and Node let&#8217;s you code in JavaScript on the server and client.</li>
<li><a  href="http://socket.io">Socket.io</a> is frequently used to add realtime functionality to Node apps.</li>
<li><a  href="https://github.com/socketstream/socketstream">SocketStream</a>: WebSocket-powered web framework dedicated to creating single-page real time websites.</li>
</ul>

<h3>What are the benefits of the real-time Web to local shops/local commerce of real-time Web? location-based, customers on the go.</h3>

The ability to let people know of short term deals or the ability to sell perishable goods at the end of the day that would otherwise be wasted. I&#8217;ve heard of a product called <a  href="http://www.sicamp.org/si-camp-uk/scotland-2011/ideas/foodini/">Foodini</a> that might be doing something in this space. FourSquare check-in can still provide more value to encourage meetups in areas where groups of friends hang out.

<h3>Typically real time does not allow for a lot of context beyond short bits of info. How does context play a deeper role as we move forward in a real time world?</h3>

As I mentioned earlier, context is absolutely key to getting real value from realtime information. Without context the data can be worthless. When something has a time constraint then context has to be present. Applications such as FourSquare add the context which gives it real value. Who has checked-in, where have they checked-in, what type of place have they checked-in to. All this key information let&#8217;s anybody viewing the check-in decide what to do. Tweets normally rely on you knowing a user. If you&#8217;ve missed the start of a conversation thread between two users you follow then, depending on the time constraints, the opportunity could be lost.

Context is essential and as realtime web applications move forward this is most definitely the area where we need to, and will, see improvement.
<p>Related posts:<ol>
<li><a href='http://www.leggetter.co.uk/2010/06/11/kwwika-world-cup-2010-real-time-push-web-app-apple-ipad-competition.html' rel='bookmark' title='Kwwika World Cup 2010 Real-Time Push Web App &#8211; Apple iPad competition'>Kwwika World Cup 2010 Real-Time Push Web App &#8211; Apple iPad competition</a></li>
<li><a href='http://www.leggetter.co.uk/2010/08/27/google-realtime-search-isnt-real-time.html' rel='bookmark' title='Google realtime search isn&#8217;t real-time'>Google realtime search isn&#8217;t real-time</a></li>
<li><a href='http://www.leggetter.co.uk/2011/06/28/recent-article-in-net-magazine-websockets-code-a-real-time-survey.html' rel='bookmark' title='Recent article in .net magazine: WebSockets &#8211; Code a real-time survey'>Recent article in .net magazine: WebSockets &#8211; Code a real-time survey</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.leggetter.co.uk/2011/11/09/the-right-place-at-the-right-time-how-the-real-time-web-influences-the-local-world.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.leggetter.co.uk/2011/11/09/the-right-place-at-the-right-time-how-the-real-time-web-influences-the-local-world.html</feedburner:origLink></item>
		<item>
		<title>The Zoom! book got me thinking about Kwwika</title>
		<link>http://feedproxy.google.com/~r/PhilLeggettersBlog/~3/-uokdssMkQg/the-zoom-book-got-me-thinking-about-kwwika.html</link>
		<comments>http://www.leggetter.co.uk/2011/09/21/the-zoom-book-got-me-thinking-about-kwwika.html#comments</comments>
		<pubDate>Wed, 21 Sep 2011 15:50:48 +0000</pubDate>
		<dc:creator>Phil Leggetter</dc:creator>
				<category><![CDATA[thoughts]]></category>
		<category><![CDATA[Books]]></category>
		<category><![CDATA[business]]></category>
		<category><![CDATA[ian sanders]]></category>
		<category><![CDATA[Kwwika]]></category>
		<category><![CDATA[unplan]]></category>
		<category><![CDATA[work/life integration]]></category>
		<category><![CDATA[Working]]></category>
		<category><![CDATA[Zoom Book]]></category>

		<guid isPermaLink="false">http://www.leggetter.co.uk/?p=21797</guid>
		<description><![CDATA[I&#8217;ve just finished reading chapter 2 of <a href="http://www.amazon.co.uk/gp/product/0273755676/ref=as_li_ss_tl?ie=UTF8&#038;tag=philleggsoftc-21&#038;linkCode=as2&#038;camp=1634&#038;creative=19450&#038;creativeASIN=0273755676">Zoom! The faster way to make your business idea happen</a> and to use one of <a href="http://scrambledup.blogspot.com/">Ian Sanders</a> favourite words it really &#8220;resonated&#8221; with me and my experiences with <a href="http://kwwika.com/">Kwwika</a>. <a href="http://www.amazon.co.uk/gp/product/0273755676/ref=as_li_ss_il?ie=UTF8&#038;tag=philleggsoftc-21&#038;linkCode=as2&#038;camp=1634&#038;creative=19450&#038;creativeASIN=0273755676"></a> Chapter 2 is entitled &#8220;The trouble with too much planning. How to unplan your [...]
Related posts:<ol>
<li><a href='http://www.leggetter.co.uk/2011/01/07/marriage-worklife-integration-real-time-web-technology-evangelism-kwwika-a-retrospective-of-my-2010.html' rel='bookmark' title='Marriage, Work/life integration, real-time web technology evangelism &amp; Kwwika: A retrospective of my 2010'>Marriage, Work/life integration, real-time web technology evangelism &#038; Kwwika: A retrospective of my 2010</a></li>
<li><a href='http://www.leggetter.co.uk/2009/08/05/book-review-juggle-rethink-work-reclaim-your-life.html' rel='bookmark' title='Book review: Juggle! Rethink work, reclaim your life'>Book review: Juggle! Rethink work, reclaim your life</a></li>
<li><a href='http://www.leggetter.co.uk/2010/06/19/want-to-try-out-the-kwwika-api-but-dont-want-to-register.html' rel='bookmark' title='Want to try out the Kwwika API but don&#8217;t want to register?'>Want to try out the Kwwika API but don&#8217;t want to register?</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[I&#8217;ve just finished reading chapter 2 of <a  href="http://www.amazon.co.uk/gp/product/0273755676/ref=as_li_ss_tl?ie=UTF8&#038;tag=philleggsoftc-21&#038;linkCode=as2&#038;camp=1634&#038;creative=19450&#038;creativeASIN=0273755676">Zoom! The faster way to make your business idea happen</a> and to use one of <a  href="http://scrambledup.blogspot.com/">Ian Sanders</a> favourite words it really &#8220;resonated&#8221; with me and my experiences with <a  href="http://kwwika.com/">Kwwika</a>.

<div style="margin:20px;text-align:centre; float:right;"><a  href="http://www.amazon.co.uk/gp/product/0273755676/ref=as_li_ss_il?ie=UTF8&#038;tag=philleggsoftc-21&#038;linkCode=as2&#038;camp=1634&#038;creative=19450&#038;creativeASIN=0273755676"><img border="0" src="http://ws.assoc-amazon.co.uk/widgets/q?_encoding=UTF8&#038;Format=_SL160_&#038;ASIN=0273755676&#038;MarketPlace=GB&#038;ID=AsinImage&#038;WS=1&#038;tag=philleggsoftc-21&#038;ServiceVersion=20070822" ></a><img src="http://www.assoc-amazon.co.uk/e/ir?t=philleggsoftc-21&#038;l=as2&#038;o=2&#038;a=0273755676" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></div>

Chapter 2 is entitled &#8220;The trouble with too much planning. How to unplan your business&#8221;. I&#8217;ve been following Ian for probably around three years now and for around the last two he&#8217;s been talking, <a  href="http://twitter.com/iansanders">tweeting</a>, blogging and vlogging about unplanning your business.

I had tried to unplan Kwwika. The fact that it was a great idea, I had real passion for it and had a lot of potential to be used in many different ways unfortunately wasn&#8217;t enough for everybody involved. There had to be more of a business plan. This meant documents and spreadsheets. These documents and spreadsheets alone didn&#8217;t clearly show a massive turnover. But the spreadsheets were full of best guess estimates and didn&#8217;t take into account all the various possibilities and things that hadn&#8217;t even been thought of yet &#8211; how could they? Kwwika didn&#8217;t need a plan beyond the basics we already had in place. We had enough information to see that it was a great idea and had lots potential. What it needed was more faith, commitment* and belief in the idea.

<em>*It would probably be better to say that the commitment needed re-focused since there was plenty of time, effort and money spent on the project.</em>

Chapter 2 in Zoom! talks about a business idea needing a &#8216;why&#8217; and a &#8216;who&#8217;. <strong>Why</strong> a business is needed and <strong>Who</strong> will make it happen. The Why for Kwwika has now been justified by services like <a  href="http://pusher.com">Pusher</a>, of which I&#8217;m now part, and the competitors PubNub and Beacon Push. There is absolutely no reason why Kwwika couldn&#8217;t still be running and competing too. The problem lies in the belief in the &#8216;why&#8217; and the restrictive nature of the &#8216;who&#8217;, where a big part of the &#8216;who&#8217; was me.

One of the things that <a  href="http://www.garyvaynerchuk.com">Gary Vaynerchuk</a> talks about quite a bit is the importance of concentrating on what you are good at. If you&#8217;re not good at something, or if you know it could be done better by somebody else, then find that somebody else and get them to do it. This means you can focus on the things you are good at. We didn&#8217;t do this with Kwwika and it was partly my fault. It was my fault because I was on a good salary, knew the project was constantly under review and knew that at the start of 2012 I wanted to buy a home for my family. These all conflicted with how I should have approached Kwwika. My salary shouldn&#8217;t have been a salary at all. It should have been a budget to spend as required in order to give Kwwika a better chance of being successful.

Knowing, or admitting, you are not good at something can be a difficult thing. I&#8217;m actually reasonably open and honest about this. I think I know what my strengths and weaknesses are although I do try to put myself in situations which I&#8217;d say are outside of my comfort zone. One example of this is that I actually really enjoy working with others although I work from home so quite frequently have to work alone. Another is giving talks. Since a kid, and a particularly bad experience trying to give a talk about the football team I was captain of, I&#8217;ve never been too keen on giving talks or presentations. But I&#8217;m now trying to put myself in situations where I have to do this to get over this worry, increase my confidence and to try and improve as a person.

All this feeds in very well to chapter 3 of <a  href="http://www.amazon.co.uk/gp/product/0273755676/ref=as_li_ss_tl?ie=UTF8&#038;tag=philleggsoftc-21&#038;linkCode=as2&#038;camp=1634&#038;creative=19450&#038;creativeASIN=0273755676">Zoom!</a>, &#8220;Getting to grips with your mission. Why you need to understand what&#8217;s driving you&#8221;. More to come as I read on.
<p>Related posts:<ol>
<li><a href='http://www.leggetter.co.uk/2011/01/07/marriage-worklife-integration-real-time-web-technology-evangelism-kwwika-a-retrospective-of-my-2010.html' rel='bookmark' title='Marriage, Work/life integration, real-time web technology evangelism &amp; Kwwika: A retrospective of my 2010'>Marriage, Work/life integration, real-time web technology evangelism &#038; Kwwika: A retrospective of my 2010</a></li>
<li><a href='http://www.leggetter.co.uk/2009/08/05/book-review-juggle-rethink-work-reclaim-your-life.html' rel='bookmark' title='Book review: Juggle! Rethink work, reclaim your life'>Book review: Juggle! Rethink work, reclaim your life</a></li>
<li><a href='http://www.leggetter.co.uk/2010/06/19/want-to-try-out-the-kwwika-api-but-dont-want-to-register.html' rel='bookmark' title='Want to try out the Kwwika API but don&#8217;t want to register?'>Want to try out the Kwwika API but don&#8217;t want to register?</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.leggetter.co.uk/2011/09/21/the-zoom-book-got-me-thinking-about-kwwika.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.leggetter.co.uk/2011/09/21/the-zoom-book-got-me-thinking-about-kwwika.html</feedburner:origLink></item>
	</channel>
</rss><!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced (Requested URI contains query)
Database Caching 22/108 queries in 0.060 seconds using disk: basic

Served from: www.leggetter.co.uk @ 2012-05-16 11:18:14 -->

