Wednesday, March 12, 2008 at 12:16 AM
The Dojo project is a leading open source Ajax framework for developing advanced web applications in JavaScript. Dojo consists of many modules for powerful cross-browser development, such as modules for offline, modules for graphics, and more. One of these modules is known as Dojo Storage.
Dojo Storage makes it possible to store large amounts of data (hundreds or megabytes of K) on the client-side, way beyond the 4K limit of cookies. Developers are given a simple key/value storage abstraction, similar to a hash table. What makes Dojo Storage unique is that it automatically determines the best way to achieve this. If Google Gears, a small open-source plug-in that teaches current browsers new tricks, is present then this will be used for storage; if the browser supports HTML 5 DOM Storage, such as Firefox 2, then this is used; and finally, if none of the others are available, then a hidden Flash applet is used to store the data permanently. There are even Adobe AIR storage providers (thanks to SitePen and Adobe) if you are running in an AIR environment!
Dojo Storage has been around for a few years. However, when Dojo made the big move to the Dojo 1.0 architecture, the Flash and HTML 5 storage providers broke; plus, new versions of Flash and new browsers made the old design inefficient. I have seriously re-factored the Flash storage system to be much faster and simpler and fixed bugs in the HTML 5 and Gears storage systems. There is now a new storage.js profile build that you can grab and include in your page to easily use Dojo Storage with the three main browser storage providers: Gears, HTML 5, and Flash. The new Dojo Storage will come out as part of the Dojo 1.1 release coming soon.
I've created a screen cast demoing the different storage providers in action:
Enjoy!

6 comments:
Your demo is a discussion but not a demo of anything. It is a single unchanging screenshot.
great! question: now that dojo-storage again support multiple storage providers (firefox 2 & 3 dom:storage first and foremost), could this mean that dojox.offline becomes more independant from gears (as ff provides storage + offline awareness)? or is there much more in gears that dojox-offline needs?
@futta: There are no plans to make Dojo Offline independent of Gears. Unlike Dojo Storage, making Dojo Offline Gears-independent won't give enough value for the code bloat it would result in becoming more abstract to the underlying provider. Maybe in a year or two when more SQL-storage based browsers appear I might make Dojo Offline more independent. Before I do that I want to seriously refactor the external API to make it smaller and simpler, and easier for read-only oriented offline web applications.
Hi Brad,
I've just watched your YouTube presentation of the new gears features. Are there any plans to implement something like gwt storage? As gwt is my favorite google toolkit it would be great to see a similar API for gwt.
There is already some api available to take advantage of gears within the gwt world but a neat storage solution checking for flash, html5 etc. would be awesome!
@futta: On second thought, I was wrong. If someone wants to help make Dojo Offline HTML 5 compliant, so that it can work with an HTML 5 compliant web browser OR Gears, then this is a valuable patch I would incorporate. I don't think it would bloat the code too bad. Futta, that would be a great project if you are interested.
@dflorey: That would be great to have GWT + Dojo Storage. I'm not a GWT guru so can't do it myself, but again, code speaks -- if you submit a patch to create some high quality GWT bindings for Dojo Storage that would be a great contribution to the community, plus I'd love to see what folks in GWT land do with Dojo Storage (plus Dojo SQL BTW). What a cool combination that would be, especially if they are using Hibernate on the server-side and playing with that stuff.
great brad, but i'm not really the person who you'd want to have code-contributions from, i can assure you ;-)
but i'll mention the "vacancy" on my blog, maybe one of my developer-readers would like to dive into dojo offline.
Post a Comment