Google Gears - Maybe all Rich Internet Applications needed was Local Storage and an Offline Mode
Stunning move by Google today in the Rich Internet Application space. While most of us (myself included) are off debating Flash vs. Silverlight vs. Apollo vs. Whatever, Google introduces Google Gears...at technology all of the above (or none of the above) can utilize...
This is a huge move and is quite brilliant. In one seemingly innocuous move (and one tiny 700k (yes, 700K) download) Google is well positioned to get Google Docs, including Writely, Spreadsheet and Presentation, along with who knows what else, enabled for offline use. And the whole thing is Open Sourced via the New BSD License.
Here's a snippet of Javascript that is used to detect if Google Gears in installed. Note the three (currently) different ways, one each for Firefox, IE and Safari.
var factory = null; // Firefox if (typeof GearsFactory != 'undefined') { factory = new GearsFactory(); } else { // IE try { factory = new ActiveXObject('Gears.Factory'); } catch (e) { // Safari if (navigator.mimeTypes["application/x-googlegears"]) { factory = document.createElement("object"); factory.style.display = "none"; factory.width = 0; factory.height = 0; factory.type = "application/x-googlegears"; document.documentElement.appendChild(factory); } } }
To the right is a dialog box that pops up to let you know that Google Gears is going to store data locally. Gears uses SQLite to store information, and you use SQL from your JavaScript to CRUD (Create, Read, Update, Delete) your data. I wonder how would would store data securely?
If you like, you can explore the databases that are created using SQLite Database Browser. This starts to explain why SQLite was a 2005 Google Open Source Award Winner. ;)
The local storage shows up when running Internet Explorer on Windows under:
C:\Users\Scott\AppData\LocalLow\
Google\Google Gears for Internet Explorer\
www.yourdomain.com\http_80
Within Firefox, the local storage databases go in:
...\Application Data\Mozilla\Firefox\Profiles\
<profile>\Google Gears for Firefox
So it seems I can't go to a Gears-enabled site in IE and later in Firefox and share data. Each browser gets it's own data storage. That means num of browsers * num of gears enabled uris = num of SQLite databases. For folks who run more than one browser, this makes the whole local storage thing a tricky issue, but I can understand why they'd segment databases by browser. I disagree, but I see their point of view.
Gears also includes a thread pool "tiny process pool" like construct that lets you perform CPU-intensive things without triggering the "Stop unresponsive script" dialog box, but you can't touch the DOM. Again, very cool and very intelligent tradeoffs.
Things are looking up, methinks. It'd be nice if Gears-like (Gearsesque?) functionality could get built into next-gen browsers the way that XmlHttpRequest did. Seems like only yesterday I was deep in the middle of the Great Cookie Scare of 1995, explaining to client what Cookies were...NO, they can't write out a megabyte sized cookie, no cookies aren't programs...glad that's over. If we've going to build some rich stuff, let's stop with the Flash Shared Objects and IsolatedStorage already and get the browser to solve this problem. Kudos for Google and let's pray there's no offline ads...
About Scott
Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.
About Newsletter
So yes, they will support offline scenarios, and no, It's not to rip-off Gears...
But Gears is _really_ interesting. Totally agree with you Sam, the possibilities are endless. The only problem is that Silverlight supports Mac, and Win... Gears supports Win and Linux (no Mac yet). So the smallest common ground is Windows :P
But once Google get Mac support, and the Mono gys get Silverlight on Linux, you can really make some compelling stuff!
I have xp. I know Google doesn't like MS but come on now. I can even test their stuff.
They're all non-native(/standard) browser plugins.
Anyone know what's to stop me sitting in a loop (in the "thread pool" natch) inserting row after row after row into your local database?
Anyone fancy hosting a database on wordpress.com? We could all share the same database!
Interesting because last I looked they were promising Safari support but it wasn't ready yet.
Don't forget JavaDB
Meanwhile, Apollo beta includes Google Gears. I'll bet you that Apollo will do as much to drive the technology to ubiquity as any single browser implementation (Firefox, Opera, etc.).
It'd be nice if Gears-like (Gearsesque?) functionality could get built into next-gen browsers the way that XmlHttpRequest did
Hear, hear! Although, you know what we'd get then... At least two (only two, if we're lucky) different implementations.
I've been getting into Javascript lately, and becoming increasingly frustrated that this very cool little language is plagued by so many variations between browsers. (Well, that and the "OO tax".)
Anyone know what's to stop me sitting in a loop (in the "thread pool" natch) inserting row after row after row into your local database?
That does sound like a danger. In my understanding, a savvy user could use the SQLite Database Browser to get rid of a garbage database.... But the question I suppose is whether/how they could be made aware that this had occurred at all.
We've been doing this for years with IE and plain cache techniques. And if you create an HTA for IE, even better... you have full access to local file system, operating system calls, etc.
What is clear from all the brouhaha over Silverlight, Flash, Gears, etc, is that developers really want to create full applications with the ease of DHTML and Javascript.
See other attempts such as Dojo storage: http://dojotoolkit.org/offline
Web browsers and standards need to catch up to this, and yes provide standardized methods of storage, updates, etc.
Web browsers and standards need to catch up to this, and yes provide standardized methods of storage, updates, etc.
Why? I'm sorry to sound MS-centric, but Silverlight provides this today (and with a much better programming model IMHO). .NET applications provide us with even more richness. Why does everything need to be in a web browser?
Vijay
Dekoh
Have you even looked at SQLite? You can stuff all sorts of things in the database and get it back out via SQL.
You can build a synchronizing n-tier web app on the desktop. If the thought of that doesn't make you drool, nothing will.
Google Apps can already automatically download applications as they are updated. All google needs to do is add these html "apps" to the list of apps available.
Hence, two things are necessary to lead to widespread adoption of browser plugins:
1) Ubiquitous client installation-base or fast, well publicized, zero-permission installs
2) Free (as in beer, with a splash of speech) application authoring
XMLHttpRequest passed both tests, by virtue of being integrated into the browser. Flash passed point 1, but failed at point 2, hence its not the defacto solution. Gears and Silverlight are iffy on point 1, so unless they're installable without administrative permissions (or easy pushed via SMS?!) their widespread within enterprise will likely be piecemeal.
"But once Google get Mac support, and the Mono gys get Silverlight on Linux, ..."
Apparently you don't realize that Miguel/Mono is becoming the most hated sellout of the entire software industry.
Check out the little google gears db query tool I implemented.
I'm finding it useful in developing client side db schemas for other gears enabled features I'm working on.
Cheers,
Joe Audette
ps, enjoying your podcasts
Comments are closed.
Exciting times ahead...