Dojo Offline Toolkit

Brad Neuberg released an exciting announcement: Dojo Offline Toolkit, a toolkit for developing AJAX web applications with support for disconnected operations.
He's planning to use a custom web proxy, installed locally, to transparently let the web application continue to run when disconnected.

In his words:

"The web browser does not know the difference between whether you are on- or off-line, since the proxy serves up the UI either way.
[...]
We don’t need to adopt radically different or exotic programming models, such as loading Single Page Applications like TiddlyWiki from the filesystem, adopting Adobe’s Apollo framework, or downloading huge, entire web servers with specialized application logic that run locally, such as Zimbra’s offline solution.

Instead, Dojo Offline’s answer is to simply use a very small, standard web proxy that runs locally, [...] caching files that wish to be cached for later access without hitting the network."


For read-only cases, such as accessing your contacts list or following driving directions, HTTP caching can do the trick, with almost no application change. You could use the normal HTTP caching from the browser, but to get some more advanced caching solution (item pinning and programmatic cache cleaning, for example), a local proxy can help, although I would rather lean towards some browser extension instead.
The bigger challenge is supporting creative activities such as writing an email, composing a blog post, editing a wiki or updating your calendar. For such scenarios, I haven't seen any model or solution that would avoid having to write a significant amount of custom client-side code, in one form or another, to handle the online/offline logic.


For example, Zimbra is adding support for disconnected operations using a local proxy, but the proxy is highly specific, running servlets that understand Zimbra's business logic. Apparently, they almost didn't change the UI AJAX client code.
Ignoring the "install" issue, I wonder whether local servlets are easier to develop than the equivalent javascript code.


In contrast, TiwyWiki ("Take It With You" Wiki) goes the javascript route (with a touch of Flash). It has the architecture of a Single Page Application (although it doesn't strictly need to be in a single page): you need to make your application cacheable, get it cached (so that the browser loads it from the cache whether online or offline), have all the user data persisted on the client-side and modify the logic to be aware of connectivity (offline operations, synchronization after getting back online).

Some of the logic can be abstracted out in a smart data access layer, which reads and updates the local store and the server-side according to the connection state. Even so, the offline mode is not transparent to the rest of the code: error cases and synchronization scenarios require more application-specific code.


In conclusion, even though I don't see this toolkit dramatically simplifying the coding of disconnected web applications, I do think it that it will supplement some limitations of the today's browser platforms and I do look forward to seeing more details emerge as the Dojo Offline Toolkit project develops. The announcement itself has already succeeded in bringing more attention to the concept of disconnected web apps, and will likely attract more brain power to this challenging problem.


Pointers:

Here are some more products, experiments and thoughts around offline AJAX:
  • Scrybe, a cool personal organizer, calendar, and notebook with offline support. I don't have access to the beta, so I'm not sure how the offline mode works (installed proxy or javascript?).
  • Carsten Bormann presented his experiment and learning at ETech on what he calls the PANIC mode (Persistency for AJAX in Networks with Intermittent Connections).
  • Also at ETech, Steve Yen (who developed NumSum, TrimQuery, TrimJunction and more) presented a talk on Web apps with the web.
  • The Gecko 1.9 roadmap (which I believes corresponds to Firefox 3) includes some improvements for offline support such as a "facility to pin sets of pages for offline use; a mechanism for detecting that the application is running offline; and events to signal that the user is going offline or returning to online operation".

Posted by Julien on January 09, 2007. Permalink
Comments
comments powered by Disqus
Trackbacks