-
Notifications
You must be signed in to change notification settings - Fork 297
FAQ
- What Is This?
- Performance & Size
- Compatibility
- Implementation & Design
- Choices, Choices
- Usage issues
A: An ultra-lightweight and flexible mobile database that easily syncs with the cloud, built for all your mobile application needs.
It was originally known as TouchDB. In January 2013 we changed the name to Couchbase Lite to tie it in with Couchbase’s branding. The original 1.0 release of TouchDB has kept the old naming, but the newer releases are known as Couchbase Lite.
A: The reference Objective-C implementation runs on iOS 6+ and Mac OS X 10.7+. There is also a Java port for Android devices.
The Objective-C implementation was at one point adapted to run in the GNUstep environment, which is portable to Linux, BSD, Solaris, etc. and even Microsoft Windows; but it hasn’t been built or run in that environment for a while, so there would certainly be more work to do to bring it back up to speed.
A: It’s passed the 1.0 milestone, and the released versions are ready to use in apps. As with any open source project, the latest commits do represent “bleeding-edge” functionality and should be used with caution.
A: The simplest is Grocery Sync, which implements a simple checklist that can sync with a server. The ToDo-Lite app is more advanced, featuring multiple lists that can be shared between users. CouchChat is a multi-user chat app.
A: Couchbase Lite itself is released under the Apache License 2.0
Some libraries that Couchbase Lite uses (FMDB, MYUtilities, and CocoaHTTPServer) have MIT or BSD licenses. We may seek relicensing or rewrite those parts of the code, to get everything under a single (Apache) license.
A: Couchbase
A: Yes; you can see a partial list on the “Couchbase Lite In The Wild” page. A notable example is Hub , a family organizer that was chosen by Apple as a “Best New Productivity App”.
A: Sure — the Google group is the best place. (You can access it on the web or subscribe to it as a mailing list.)
A: Version 1.0 compiles to about 500k bytes of optimized ARM7 code. (The framework you’ll download or build is much larger because it contains a lot of linker metadata, as well as x86 code for the simulator, which don’t get copied into your app.)
A: About 100ms to initialize the library and open a small database. That’s a cold launch; if the app has been launched and quit recently, leaving stuff in cache, it’s more like 60ms. (Measured on an iPad 2.)
A: Fast enough for the kinds of data sets mobile apps would be expected to use. It’s effectively instantaneous for small data sets. It won’t handle big data as well as Couchbase Server, but it keeps up pretty well with tens or hundreds of thousands of documents. And it doesn’t mind arbitrarily large binary attachments; those are kept as files in the filesystem.
A: There aren’t any hard limits in Couchbase Lite itself, nor in the underlying SQLite database. The most likely practical limit is the available disk/flash storage on the device, and of course app responsiveness as query times increase (see above).
Very large amounts of JSON data in documents will become expensive to parse, and storing binary data is inefficient in JSON anyway, so large data should be stored as attachments. Attachment size is unlimited and read/write performance is about the same as regular files.
Documents being replicated to the Couchbase Sync Gateway are restricted to 20MB of JSON and 20MB for each attachment, due to size limitations of Couchbase Server.
A: In the ways that matter, yes. The data model and replication protocol are the same. The REST API is compatible, although you talk to the engine in-process rather than over a socket. Some of the more server-centric features of CouchDB, like user accounts, aren’t supported.
A: Yes, its replication protocol is entirely compatible. Apps using Couchbase Lite can sync with servers running Apache CouchDB, as well as with Couchbase Server via Sync Gateway.
A: The [Sync Gateway](https://github.com/couchbaselabs/sync-gateway) acts as a server-side bridge between Couchbase Server and Couchbase Lite. Once your data is synced to Couchbase Server you can use map reduce to build indexes across the full dataset.
A: Yes. Revision trees are implemented, and preserved across replication.
A: Yes, although views are implemented in native code (e.g. as blocks in Objective-C.) The same goes for filter and validation functions. (It’s possible to use JavaScript-based functions if you’re willing to link in some extra code and libraries.)
A: The add-on CouchbaseLiteListener framework provides an HTTP listener. It’s mostly there to enable Couchbase Lite-to-Couchbase Lite (P2P) replication as well as making testing easier, and to support PhoneGap style HTML5 development.
A: CouchApps running in PhoneGap are definitely an interesting mobile platform. We have a PhoneGap plugin showing how to combine Couchbase Lite with PhoneGap. Many CouchApps should be able to run with only minor modifications. The major compatibility issue is that Couchbase Lite’s REST API doesn’t support list or show functions.
A: Largely because SQLite is already available as a shared library on every platform we’re interested in; this keeps our code size down and simplifies the build process.
Additionally, both Berkeley and Kyoto have GPL-like licenses that are less friendly to commercial developers (especially iOS developers) and incompatible with the Apache license of Couchbase Lite itself.
A: World-class, highly-flexible data sync capabilities that go way beyond what you can get from iCloud. Another factor is that the API is (we think) simpler and easier to use than CoreData’s.
A: Cloudant Sync is actually based on a much older prototype version of Couchbase Lite (then called TouchDB). Cloudant forked the code in early 2013. Their version doesn’t include the many performance and stability improvements that have gone into Couchbase Lite since then.
A: As with the previous comparison to CoreData: the big reason is sync. If your users want to work with their data on multiple devices or platforms (including the Web), or have it transparently backed up, the replication capabilities in Couchbase Lite will make it very easy compared to the pain of implementing sync yourself, or trying to duct-tape your custom SQLite database to the iCloud APIs.