Skip to content

Couchbase Lite vs iCloud

Chris Anderson edited this page Jul 30, 2013 · 2 revisions

I was recently asked to describe what advantages Couchbase Lite has over iCloud (Apple's document and data sync system for iOS and Mac apps.) Here's what I wrote.

Conflict Resolution. I'm really not sure what iCloud does about conflicts; I couldn't find a description in the Apple docs. This is important and hard to get right. The app is ultimately responsible for merging changes within a record, but the sync framework needs to identify the conflicting revisions. Couchbase Lite tracks revision histories and propagates a tree of revisions, which is the most reliable way to do it.

Flexible Schema. iCloud's structured storage is accessed via CoreData, which is an object-relational mapping and thus strongly schema-based. You can update a CoreData app's schema, but migrating existing data can be tricky. (I have no idea what happens if iCloud tries to sync between two devices that are running two versions of an app that use different schema!) NoSQL databases like Couchbase Lite are a lot more flexible about how data is stored, so this is less of an issue.

Sharing. iCloud only syncs between devices owned by the same person. Couchbase Lite can do that; or share in small groups (like Glassboard, GroupMe, etc.); or publish to the public (like a blog or Instagram). Hybrids of those are possible too.

Cross-Platform. I'm willing to bet there are iOS users who also have an Android device, or run Linux on their PC. iCloud won't work for that, but Couchbase Lite will. Couchbase Lite even supports PhoneGap interfaces for maximum portability.

Flexible Storage. iCloud puts everything on Apple's servers. I'm sure these are reliable and secure, but it's good to have choices. Couchbase Lite can sync to your own servers; to a desktop machine (the way Things does); or even peer-to-peer.

Enterprise Data. The only way to get data into an iCloud account is from an iOS device or Mac. But a frequent desire in mobile apps is to view small subsets of a huge upstream database (whether enterprise sales data, scientific observations, or consumer info like movie reviews) and be able to work with them while offline or bandwidth-limited. Couchbase Lite connects to Couchbase Server via the Sync Gateway which has supports fine-grained access contol and subset sync.

Flexible Topology. A star is the easiest, with devices all connecting to a single server, but Couchbase Lite allows for peers to sync to each other, creating a mesh (whether permanent or ad-hoc.) You could set up home/office servers that devices sync to, which in turn sync to a cloud service.

Open Code & Protocols. Apple's not going to show you iCloud's source code, or even describe the details of the protocols. If you find bugs, you have to wait for Apple to acknowledge and fix them. If you want to write your own client library, good luck reverse-engineering. Couchbase Lite (like all other Couchbase products) is open source, and the protocols are REST-based and publicly documented.