CouchDB-compatible embeddable database engine for mobile & desktop apps

View the Project on GitHub couchbaselabs/TouchDB-iOS

Welcome To TouchDB

by Jens Alfke (
with contributions from
Alexander Edge, Chris Kau, David Venable, Derek Clarkson, fcandalija, J Chris Anderson, Marty Schoch, Mike Lamb, Paul Mietz Egli
and technical advice from
Damien Katz and Filipe Manana

TouchDB is a lightweight Apache CouchDB-compatible database engine suitable for embedding into mobile or desktop apps. Think of it this way: If CouchDB is MySQL, then TouchDB is SQLite.

By "CouchDB-compatible" I mean that it can replicate with CouchDB, and that its data model and high-level design are "Couch-like" enough to make it familiar to CouchDB/Couchbase developers. Its REST API is nearly identical, though it doesn't support a few CouchDB features, like user accounts, that aren't useful in mobile apps. Its implementation is not based on CouchDB's (it's not even written in Erlang.) It does support replication to and from CouchDB.

By "suitable for embedding into mobile apps", I mean that it meets the following requirements:

And by "mobile apps" I'm focusing on iOS and Android, although there's no reason we couldn't extend this to other platforms like Windows Phone. And it's not limited to mobile OSs -- the Objective-C implementation runs on Mac OS as well, and on Linux and other Unix-like OSs via GNUstep.

The Future — Couchbase Lite

TouchDB has reached a stable 1.0 release, and we encourage you to use it in your apps, but work continues.

On the technical front, we're merging the database engine and the public API layer (CouchCocoa), which used to be separate frameworks, into one. This eliminates a lot of intermediary code and simplifies the flow of control, meaning smaller code and faster performance. (In particular, there were several layers of marshaling to and from JSON that are now gone.)

At the project level, it's being promoted from a 'labs' project to a real Couchbase, Inc. product. As such, the name is changing to Couchbase Lite.

Inevitably, the refactoring and renaming have caused some API incompatibility. Fortunately it's pretty easy to update your code from TouchDB/CouchCocoa to Couchbase Lite.

Couchbase Lite is still in prerelease status (as I write this in March 2013) but evolving quickly. If the New Hotness interests you more than stability, please check it out.

More Information


* TouchDB was at one point running on Linux, using GNUstep and libobjc2. GNUstep also supports Microsoft Windows via MinGW. The GNUstep build hasn't been kept up to date, however, so there would definitely be some work involved in getting it running again. We don't currently have plans to do this, but we'd love to support anyone who wants to dive in.



Development Status

TouchDB 1.0 was released on November 5, 2012. There was much rejoicing.

Development continues in the Git repository. In general, the "stable" branch represents the latest stable release, while the "master" branch has the latest commits and may not be stable. Other branches probably represent experimental or unfinished features.

Building TouchDB

On a Mac

(You might prefer to just download the latest stable release. But if you want to build it yourself...)

For full details see the wiki page. The basic steps are:

  1. Clone the TouchDB repository to your local disk.
  2. In that directory run "git submodule init" and then "git submodule update". This will clone the dependent library repos (such as FMDB and MYUtilities) into the vendor/ subdirectory.
  3. Open the Xcode project and build the "Mac Framework" and/or "iOS Framework" schemes.

With GNUstep

Please refer to the files BUILDING.txt and SETUP.txt in the GNUstep directory.