Sunday, August 12, 2007 6:22 AM
by
akhus
Next Generation browsers and the future of offline storage using DOM and SQL
After all the hype around Google gears offline web applications began to emerge as an alternative to desktop apps, and further a new HTML 5.0 specification which is still in progress is defining a new model for persistent storage. HTML 5.0 defines two forms of offline storage for web applications, the first is already implemented in Firefox which is the DOM storage which is an alternative storage for cookies that allows for string key / value pairs to be stored for up to 5MB per domain, and the second is a local SQL database storageJ. Unfortunately the DOM storage is not available in IE 7, however IE is using another storage model called userData Behavior which allows for 1MB per domain. Both models provide a way to store more data beyond cookies which is limited in size and also has performance issues since it is traversed with every call between the client and the server.
The DOM storage provides sessionStorage and globalStorage. SessionStorage allows sites to add data to the session, and is accessible to any page from the domain opened in the window. The latter storage mechanism is designed to span multiple windows, and last beyond the current session and this is known as globalStorage. One of the first applications that made use of the DOM storage specification in Firefox 2.0 and beyond is halfnote which is a note taking application that allows users to save their notes on the local store and make it available even when there is limited internet connectivity, which is somehow like Google gears.
However, what about gears localServer? I haven't dug really into Firefox implementation of that but I noticed that the HTML 5.0 specification has defined a section for offline applications and custom browser protocol handlers. HTML 5.0 defines that browsers can now know the state of the client whether the browser is online or not through the navigator.onLine attribute. Further browsers can now plug-in custom protocol and content handlers that can handle certain protocols like http or ftp even if the application is offline, and by that it can allow for some specific websites to be handled locally without the need to go online.
Now the most interesting part is that future browsers might allow for client side database storage, and of course I don't know when or if it is going to be supported in either IE or Firefox but I suspect they wouldJ. Now HTML 5.0 specification defines a way for browsers to use client side DB, that is SQL based and allows for reading and storing data using SQL queries. Now that is confusing, why would Google go through such an investment when HTML 5.0 is working on a specification for browsers can to make use of such technology? Well I don't have the answer to that, but definitely the next 2 years are going to be very interesting and will probably provide a new generation of Web 3.0 applications!!
Finally before I go, just to let you know that Firefox allows currently for SQL storage since it has a SQLlite engine already provided! Well not really as you would expect, this storage is only allowed for trusted Firefox extensions only, and not web pages. Moreover, it is still undergoing changes so probably if you start building on it; it might change in the future. However, if you're interested you can read the specification here.