Skip Links

Realtime's push beats Ajax pull

If you're trying to build Web apps that can provide real time updates for vast numbers of users, don't let them 'pull' data, use Realtime to 'push'

By , Network World
November 15, 2012 06:56 PM ET
Gibbs

Network World - How's that there cloudy thing working out for you? Sure, you get flexible, elastic infrastructure at a pretty good price, but what about your data transfer costs? The same question applies to "traditional" hosted apps; data transfer costs can mount up quickly for large client populations.

If your online clients do any kind of frequent or quasi real-time data retrieval such as regularly polling your servers for updates, then you're probably getting used to writing pretty large checks.

The problem is that every "pull" by a client (open a socket, request data, close the socket) doesn't necessarily return an update, so you will be wasting bandwidth (and therefore money )for each "pull" where there's no new content.

IN THE NEWS: High performance computing, the latest 'it' thing in the cloud

So how often should you "pull"? Well, you can either poll the server very frequently, in which case a large percentage of update requests will return no data, or you can poll less frequently at the risk of the client getting a delayed update. If your objective is to provide, say, real-time breaking news headlines, then to be the top news provider you'll probably design the client-side code that "pulls" the headlines from your server to make very frequent updates to keep your edge over other news channels. But the more frequent those "pulls" when there is no update, the more bandwidth is wasted.

Is there a better way? Yep. Rather than "pulling" data from servers, how about "pushing" it to clients? When you use a "push"model the client-side code opens a connection to your server and then waits either to be told there's an update to be fetched or the updated contents are actually sent.

This push model is something we see built into many apps on Apple platforms for notifications and conceptually it's pretty simple. In practice, building a push infrastructure that can operate globally with low latency is a serious engineering task, but a Portuguese company, Realtime, has solved this problem.

Realtime offers the Realtime Messaging System & Framework, which consists of the Open Real-time Connectivity (ORTC) framework (a cloud-based many-to-many messaging service) and the "eXtensible RealTime Multiplatform Language" (xRTML).

The ORTC network is Realtime's secret sauce, providing low-latency message transfers simultaneously to millions of clients. (The company's site has a demo of its technology built in on its homepage that shows, via ORTC and xRTML, the performance of ORTC. At the time of this writing it is handling 706,506 messages per second and has serviced 165,668,475 connections in the last 24 hours.)

What's really cool about Realtime's xRTML is how easy it is to build into a Web app (the company provides libraries for JavaScript, PHP, ASP.Net, Java and ActionScript, as well as plug-ins for WordPress, Eclipse and Joomla, and an extension for VirtueMart).

Realtime also has great demos and tutorials. For a good intro to using xRTML, try the "Getting Connected" interactive example after you sign up and receive your developer key and authorization token.

Our Commenting Policies
Latest News
rssRss Feed
View more Latest News