NoSQL Databases Go Mobile

February 23, 2011 Off By David
Grazed from Internet Evolution.  Author: Sean Gallagher.

Key to many high-demand Web and cloud applications today is NoSQL, a collection of database and application technologies that eschew the SQL query language and many of the trappings of relational databases. And as developers of applications for mobile devices increasingly plug into the cloud to power their apps, some are turning to NoSQL again. But this time, they’re putting NoSQL databases right on the mobile device.

While relational databases are great for handling business transactions, they don’t play well in the distributed world of the cloud. SQL-driven interfaces can add latency to Web applications — especially rich Internet applications based on tools like Microsoft’s Silverlight and Adobe AIR, as well as Ajax and HTML5 applications. And they don’t distribute well. To deal with more users, you typically have to make your relational database server bigger, whereas Web apps scale up by adding more servers.

That’s why open-source NoSQL databases like Hadoop’s HBase, Cassandra (originally developed to power Facebook messaging), CouchDB, Memcached, and MongoDB have taken the place of mySQL and other relational databases under the covers of social networking sites and cloud platform providers.

These databases use programming interfaces that are more Web-friendly, have built-in replication capabilities and high-availability, and are resistant to crashes and corruption because of the way they’re built. And they require significantly less administration, making it easier to scale them up without scaling up manpower as well.

Enterprise IT organizations are finding that some of these features that make NoSQL databases ideal for the Web make them a good fit for mobile platforms.

The most obvious of these, aside from the small footprint of NoSQL platforms like CouchDB, is their ability to synchronize with remote databases. Despite the ever-increasing bandwidth of mobile networks, they’re inherently unreliable, as any iPhone owner knows. That may be a minor inconvenience for applications like social networking or email. But loss of a connection to data for a real enterprise application means lost time, lower efficiency, and lost money. So mobile applications need to have a local cache of data to work with when the network disappears or is overcome by usage. And that data needs to be able to synchronize with the enterprise whenever the network becomes available again, without the user having to worry about it.

There are SQL-based synchronization solutions; Sybase’s SQL Anywhere and UltraLite have been solving the problem for mobile applications for a long time, connecting back to enterprise data through a mobile gateway to handle the synchronization. But UltraLite isn’t available yet for Google Android, and the iPhone version of UltraLite carries a seat license that could be prohibitively expensive for deployment at the enterprise level.

Couchbase’s CouchOne (which will soon be renamed Mobile Couchbase) is the first commercially supported NoSQL tool to arrive on mobile devices. Based on CouchDB, CouchOne is available now on Android, and Couchbase (which was formed by the merger of two NoSQL companies in early February) is working on versions for Apple’s iOS, HP’s webOS, BlackBerry, and Windows 7 Phone.

It’s more than just a database — CouchOne is also essentially a local Web server and JavaScript interpreter that runs right on the client. That means that enterprise developers can use the same skills they use to build Web applications to create their mobile applications as well, only having to use the native development languages for devices when they need to leverage the built-in features of the smartphone or tablet (such as the camera and GPS in the device).

There are some downsides to NoSQL. For one thing, most organizations don’t have developers with a lot of experience with NoSQL development. What you save on seat licenses and server costs could get eaten up in additional development and support costs. And while NoSQL databases such as CouchDB are fast, they aren’t well suited for the types of applications that SQL was made for — ad hoc queries, analysis, and business intelligence.

But NoSQL can offer developers a way to bring in data from disparate sources without the pain of schema integration that SQL databases would require. With CouchDB’s document-based model, for instance, data can simply be brought straight in, without having to do the mapping.