Home   tech  

How google docs worked before the websockets were invented

Google Docs originated from two separate products, Writely and Google Spreadsheets, which were merged into Google Docs & Spreadsheets around 2006. These services indeed predate the formal standardization of WebSockets in 2011. The ability of these platforms to offer real-time features before WebSockets became a standardized part of the modern web is a testament to the innovative approaches developers used to enable live, collaborative experiences online. Here's how they managed it:

Techniques Used Before WebSockets

Polling

Early real-time applications often used polling, where the client repeatedly requests (polls) the server at regular intervals to receive new updates. This method was simple to implement but inefficient, as it generated a lot of unnecessary network traffic and could introduce noticeable latencies in the real-time updates.

Long Polling

An evolution of the polling technique, long polling involves the client making a request to the server, which then holds the request open until new data is available to send back to the client. This approach reduced unnecessary network traffic and improved the real-time aspect of communication, but it was still a workaround and could strain server resources.

Comet

Comet is an umbrella term for techniques that enable web servers to send data to the client immediately when it becomes available, without the client having to request it. Long polling is one of the techniques under the Comet umbrella. Comet applications could be built using various technologies such as iframe class='youtube-video', XMLHttpRequest, and script tags with long-held HTTP requests.

Transition to WebSockets

WebSockets, standardized in 2011 as part of HTML5, provided a more efficient and standardized way to achieve real-time communication between browsers and servers. It allows for full-duplex communication on a single, long-lived connection, significantly reducing latency and overhead compared to HTTP-based methods like polling and long polling.

How Services Adapted

Services like Google Docs initially relied on these earlier techniques to provide real-time collaboration features. As WebSockets and other modern web technologies became available and matured, many services transitioned to these new technologies to improve performance, scalability, and the user experience. The adoption of WebSockets allowed for more efficient real-time data exchange, enabling smoother collaboration and interaction in web applications.

Published on: Feb 28, 2024, 02:12 AM  
 

Comments

Add your comment