11 innovative solutions to bring real time push to your webapp

February 2, 20120 Comments
Facebook Twitter Pinterest Plusone

As the web becomes more and more realtime across different applications, the browser technology to support such a movement has been playing catchup. There have been plenty of work arounds – polling for new messages (kind of the coding equivalent of your kids in the back of car asking ‘Are we there yet?’ continually) versus true pushing of messages from the server (parents telling the kids ‘we have arrived) isn’t an ideal scenario. The load on the server (from potentially thousands of screaming kids) is a problem, and in some cases, the server my have arrived at the destination before the question comes from the back seat.

In any case, its not true realtime communication.

One of the most interesting parts of the HTML5 specification designed to solve these technical problems, is WebSockets – a way for browsers to communicate in realtime between server and client, by pushing messages directly to the browsers who need the information.  There are a number of libraries, startups and open source projects which are making life easier for developers to integrate this type of technology today – (Although its worth pointing out that the specification is in something of a flux at the minute). Some of them are truly realtime, others offer a half way house until this browser technology and its widespread adoption becomes more commonplace. With scaling often being an issue for real time systems, some of these technical solutions and hosted platforms offer developer solutions to what can be a tricky technical problem.

URL: http://pusher.com/

Pusher is a hosted service for quickly and easily adding realtime features into web and mobile applications. The main benefit is that Pusher is scalable out of the box, as they take care of any infrastructure requirement, and lets you concentrate solely on building the application layer. They are used by numerous startups, and offer a variety of hosted plans that match any requirement.

Some of the neat features which are available out of the box with Pusher include authenticated channels so you can control who has access to the messages you broadcast and you can also easily receive a list of users connected to a particular channel.

URL: http://www.pubnub.com/

PubNub is another hosted service for real time. Again, they take of the scaling issues associated with real time communications as part of their overall service.  The fundamental difference of PubNub versus Pusher, is that the transport mechanism used is HTTPstreaming, whereas Pusher exclusively uses WebSockets.  This isn’t necessarily a negative; arguably the reasoning for this is that currently many WebSockets solutions, even those which degrade gracefully, don’t work for all situations.

Pubnub runs on C behind the scenes, and there are out of the box client libraries for Javascript, iPhone, Android, PHP, Python, Ruby, Java, C, and Flash so developers have some of the donkey work already done for them.

URL: http://x-stream.ly/

From the guys behind real-time application platform Cerrio – X-streamly is a spin off application which is both affordable and scalable. They are built on top of socket.io and provide cross platform support via this library. A number of language APIs are available but they do offer to build out support on your language of choice if you happen to be using something else.

URL: http://socket.io/

Socket.IO aims to make realtime apps possible in every browser and mobile device, blurring the differences between the different transport mechanisms. It gracefully falls back to the most capable transport mechanism, with native Websockets being the most capable. In essence, Socket.IO lets you forget about the problems of cross platform capability, and concentrate on building your application without hassles.  It also enhances websockets by providing built-in multiplexing, horizontal scalability, and automatic JSON encoding/decoding.

URL: http://beaconpush.com/

Beaconpush offers message persistence meaning that between page reloads and potential restarts of browser/tab, messages will not be lost. You can also address individual users on particular channels in the same way as PusherApp, and whilst it started life as a fully hosted solution, also offers a half way house in the form of  their ‘On-site’ edition. This is an alternative hosting model than that in the the cloud-hosted version in the sense that you host the Beaconpush server(s) within your own data centre allowing more control over scaling and technical approaches within your own system architecture.

URL: http://www.spire.io/

Spire.io runs on a highly elastic worker-based architecture, backed by Node.js and Redis, with a secure REST-based API which currently providing a notification / messaging service. They are only recently out of Beta, but these guys are hard core javascript geeks, and bring with them a wealth of technical talent. Definitely one to watch.

Notable Mentions

URL: http://nodejs.org/ – It’s hard to mention the word real time without mentioning Node, which brought evented javascript to the masses.  Built on Chrome’s JavaScript runtime Node.js uses a non-blocking input / output model that makes it fast and easy for the majority of tasks in modern web development. It’s maturing rapidly with support and extras from the open source community.

URL: http://labs.gameclosure.com/hookbox/

Hookbox is a Comet server and message queue that tightly integrates with your existing web application via web hooks and a REST interface.

URL: http://www.ape-project.org/

APE is a full-featured OpenSource solution designed for Ajax Push. It includes a comet server and a Javascript Framework. APE allows to implement any kind of real-time data streaming to a web browser, without having to install anything on the client-side.

URL: http://faye.jcoglan.com/

Faye is a publish-subscribe messaging system based on the Bayeux protocol. It provides message servers for Node.js and Ruby, and clients for use on the server and in all major web browsers.

URL: https://github.com/hookio

Hook.IO is a distributed EventEmitter and i/o framework for Node which enables the use of small chained processes, each focused on solving one particular task, that forms building blocks for larger and more complex applications. You can build up your application piece by piece by gradually adding small processes that communicates by sending and listening to events.

Filed in: Programming
Tagged with:

About the Author ()

Paul is a regular 30 year old web bloke / programmer with a penchant for online marketing. This blog is a personal outlet, with an eclectic mix of articles.

Leave a Reply

Back to Top