|By Frank Salim||
|December 16, 2008 10:12 AM EST||
Chat rooms and live peer-to-peer chat on the web are high on the list of stunning rich application features that can still drop jaws. Facebook recently launched an integrated web chat implementation to much fanfare. Their impressive Erlang and C++ chat infrastructure showcases real-time web techniques and live, interactive interface elements. However, following Facebook's lead is actually not that hard if you use the right approach.
The two main difficulties faced by Facebook, Google, or any other web giant that wishes to deploy a chat application are scaling out an inconceivably large messaging back end and sending real-time messages to the browser. The first problem is one that many of us would like to have, but few actually encounter. The second problem is getting much, much easier to solve. Web chat is about to go mainstream, thanks in large part to a new HTML 5 feature called Web Sockets.
Chat Is Full-Duplex; the Web Is Not
The challenges in bringing real-time messaging (chat, for example) to web applications stem from the fundamental design of the web. It is, after all, a system designed for navigating hypertext documents. The request-response model is perfect for document retrieval, but it's less perfect for an application platform. Some applications are exceptionally bad fits.
Chat requires full-duplex communication. That is, data must be able to flow bidirectionally. This is a clear necessity for chat, as messages may originate on either the server or the client and must be transmitted without delay. After all, instant messaging is of little use if it isn't instantaneous. HTTP explicitly eliminates the ability to send information over the network in either direction at will at the same time.
Since nearly anything is possible, some tenacious developers have shoehorned full-duplex communication into existing web browsers. Comet long-polling, iframe streaming, and other techniques have all been applied in pursuit of this goal. Each technique has weaknesses, however, and even Comet techniques that allow data to stream down from the server cannot avoid initiating a new request for each upstream message. While a new request might not seem like much, each HTTP action causes several hundred bytes of header data to be generated, transmitted, and parsed. Even when bandwidth and computing resources are cheap, the additional latency incurred by a full round trip hurts real-time interactivity.
Using today's browser technology for both upstream and downstream, there is significant overhead to real-time communication. Despite this, some have been willing to stomach the complexity and inefficiency to run applications like chat on the web without succumbing to the temptation of proprietary plugins.
HTML 5 Web Sockets
The HTML 5 standard specifies new APIs for storage, drawing, drag-and-drop, and other areas that have made web programming painful. Browsers have already begun incorporating parts of HTML 5 (canvas, for example) even though the specification is far from complete. The HTML 5 Communication section includes two additional connectivity features: Server-Sent Events, a standardization of HTTP push, and Web Sockets, a cross-domain safe, full-duplex connection. Server-Sent Events will make real-time updates and notifications easy, and Web Sockets provide the functionality necessary to build chat for the web without the previously required hackery.
|393rocker 11/02/09 10:02:00 AM EST|
do u have a source code of implementing IM? if i start from the scratch..
The cloud promises new levels of agility and cost-savings for Big Data, data warehousing and analytics. But it’s challenging to understand all the options – from IaaS and PaaS to newer services like HaaS (Hadoop as a Service) and BDaaS (Big Data as a Service). In her session at @BigDataExpo at @ThingsExpo, Hannah Smalltree, a director at Cazena, provided an educational overview of emerging “as-a-service” options for Big Data in the cloud. This is critical background for IT and data professionals...
Dec. 9, 2016 07:00 AM EST Reads: 4,337
Dec. 9, 2016 06:00 AM EST Reads: 821
Dec. 9, 2016 05:00 AM EST Reads: 3,133
Dec. 9, 2016 04:45 AM EST Reads: 493
Dec. 9, 2016 04:30 AM EST Reads: 1,031
Dec. 9, 2016 04:15 AM EST Reads: 3,550
Dec. 9, 2016 04:15 AM EST Reads: 1,453
Dec. 9, 2016 04:00 AM EST Reads: 587
Dec. 9, 2016 04:00 AM EST Reads: 6,342
Dec. 9, 2016 03:30 AM EST Reads: 496
Dec. 9, 2016 03:00 AM EST Reads: 412
Dec. 9, 2016 02:15 AM EST Reads: 6,236
Dec. 9, 2016 02:00 AM EST Reads: 3,062
Dec. 9, 2016 01:45 AM EST Reads: 1,956
Dec. 9, 2016 01:45 AM EST Reads: 995