-
Notifications
You must be signed in to change notification settings - Fork 301
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 5+ and Mac OS X 10.7+. There is also a Java port for Android devices.
The Objective-C implementation was partially adapted to run in the GNUstep environment, which makes it 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 usd with caution.
A: There’s a Grocery Sync app for iOS that implements a simple checklist that can sync with a server.
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 list on the “Couchbase Lite In The Wild” page.
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: Right now (January 2013) it compiles to about 400k bytes of optimized ARM7 code.
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. This is on an iPad 2; older devices will be a bit slower.
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 to my knowledge in SQLite. 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).
I’ve heard that Android has a 2GB file size limit; but this should be less of a problem for Couchbase Lite, because the database file doesn’t grow as fast (it doesn’t need explicit compaction) and because it doesn’t store attachments inside the database file.
A: In the ways that matter, yes. 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. That’s a very important goal. 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 for size reasons it doesn’t include a JavaScript interpreter, so 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: There’s an experimental HTTP server extension called CouchbaseLiteListener. 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. Most CouchApps should be able to run with only minor modifications.
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: Because it’s a lot smaller, starts up a lot more quickly, and is easily embeddable into an app. Those are important factors for mobile app developers (and some desktop app developers too.) If you’re working on server-side software they probably don’t matter to you, or at least don’t outweigh the drawbacks.
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: 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.
Q: How do I cancel a persistent, continuous replication?
A: Delete the CBLReplication model:
[repl deleteDocument: &error];Alternatively, you can do:
[db replicateWithURL: nil exclusively: YES];which will delete all replications involving that database.