An Online/Offline web application based on CouchDB

Offline...It seems that a turning point has been reached: web applications are easier accepted than traditional desktop applications.

In a not so distant past, MS Office was the de facto standard when it came to what an application should look like and how it should function. Nowadays, more and more users can't handle these tranditional desktop applications anymore. If it doesn't look like a web application and doesn't behave like a web application, they often don't know how to properly deal with it. This, of course, hurts the acceptation of new software within an organization.

This also largely applies to "mobile apps" which are functionally and visualyl very close to web applications.

This is actually good news since web applications offer many advantages in the area of maintenance ("SaaS"), cross platform support (desktop, mobile) and storage ("in the cloud").

There is, however, one point where web applications lag behind traditional applications: offline support. Despite what mobile operators want us to believe, there isn't always a good (or affordable) internet connection and this will unfortunately remain this way for a while.

Web browsers offer several ways to support offline storage, but these are rather low-level. There are no high level frameworks for offline web application synchronization, it often has to be handmade for each new applocation. Also, the specific storage support varies greatly between different browsers and platforms.

But now there's a "stack" that makes offline data storage/synchronisation childishly simple: PouchDB. PouchDB is a client for the distributed CouchDB document store. The application will synchronize if there's a connection available, and it will keep functioning on a local database once the application goes offline. And it supports many platforms!

To find out how well this works in practice, we've created a prototype offline application: an online/offline document editor based on WebODF, a 100% javascript Open Document Format editor.

And although the code is still very limited, the application already offers much of the desired functionality:

  • When the application loads, the data (ten documents) will be synchronized.
  • When the application goes offline, documents can still be opened, edited and saved.
  • Once the connection is re-established, documents will be synchronized.
  • If multiple instance of the applications are running (e.g. one on a Desktop system and one on a mobile device), the documents will be nicely synchronized between these instances.

It's still just a prototype: it has limited usability, it doesn't offer extensive editing controls and there is no conflict resolution. But despite these restriction, it already looks very promising.

Last updated Feb. 4, 2014, 11:26 a.m. | offline pouchdb couchdb webodf angularjs web application

No comments

Post a comment:

captcha