Since the early day of the Internet, the web mostly consisted of single, simple text pages linked to each other. Users back then came to the World Wide Web just to read and/or retrieve information that had little or no images. That changed a little with the introduction of Web 2.0 movement in 2004 which encourage user’s engagement with each others via collaboration, social media dialogue that put strong emphasis on user generated data. Moving on to 2014, the advancement of new non-blocking IO with the support for HTML 5 Web socket on modern browsers, businesses should start looking at how they can utilize the benefit of two-way communication that WebSocket protocol brings.
The standard model of interaction between a web user agent such as a browser and a web server such as IIS, Apache is that the user agent makes HTTP requests and the server makes a single reply to each one. In the case of a browser, the request is made by clicking on a link, entering a URL into the address bar, clicking on the forward or back buttons, etc. The response is treated as a new page and is loaded into a browser window.
All of these are still browser to server communication. What is missing is server initiated communications to the browser. In fact, this can now be filled by Web socket protocol: the browser (or any user agent) keeps open a long-lived TCP connection to a Web socket server. The TCP connection allows either side to send arbitrary packets, so any application protocol can be used on a web socket.
Other benefit of the web socket’s are the reduction of data and the latency on the network since the overhead of initiate the http connections are smaller. According to Ian Hickson, the html5 specification lead, Web socket can:
“Reduce kilobytes of data to 2 bytes…and reducing latency from 150ms to 50ms is far more than marginal. In fact, these two factors alone are enough to make Web Sockets seriously interesting to Google.”
Source : http://www.websocket.org/quantum.html
Indeed the Web Socket protocol has opened the doors to many applications which were not feasible (or were hard to achieve for the desired performance) such as
- Media chat
- Logging analysis
- Real time data display
- Collaboration software to enable multiple users to view/edit same document
- Interactive educational tool
- Location based applications where user can have data on their mobile device as soon as their location is sent back to server
Below is an example of web socket enabled application where multiple mobile client can communicate with each other via a web socket server.
There is an old saying “The sky is the limit” and the new, interesting and light-weight way to communicate with end user via Web socket provides many opportunities to enhance the way your business communicates to your users. Talk to us today and let us help your business utilise these new technologies.