Tag Archives: TouchDB

NoSQL on Android


NoSQL on Android

There are various NoSQL solutions for mobile platforms such as the iOS and Android. Here, we will look atCouchbase Lite (CBL – the successor of TouchDB), a lightweight, full-featured, embedded JSON database.

Why a full-feature database instead of just a wrapper for a cloud service? Basically, responsiveness. The idea is that the application should always be available to users even when the network is down or slow. Of course, being able to work with data locally also means that we’ll have to sync with the server at some point.

Note that CBL is significantly different from Apache CouchDB despite the “Couch” part.

Now, let’s get down to business and create a small Android application (entire code available on GitHub) which sets up a database using CBL’s Native API, and run basic CRUD operations.

After going through a relatively easy setup ( this one is for good old Eclipse users, that one for Android Studio fans), let’s start by writing some code: