Apple's iCloud is Running Into the Fact that Database Syncing is Difficult

Ellis Hamburger has an excellent post at The Verge that talks about Apple's iCloud service and its problems:

Nearly two years later, customers demand iCloud integration more than ever from third-party developers, but it’s a total mess to implement. "iCloud hasn’t worked out for us," wrote Daniel Pasco, CEO of development studio Black Pixel this past week. "We spent a considerable amount of time on this effort, but iCloud and Core Data syncing had issues that we simply could not resolve." Pocket lead developer Steve Streza piled on with a cutting tweet: "Remember that @blackpixel has many of the brightest people in Cocoa development. If they couldn’t get iCloud working, who can?"

It should be noted that the issues surrounding iCloud difficulties center around Core Data (an object graph and persistence framework) syncing. In general, the key-value and document syncing parts of iCloud work as advertised. However, when it comes to Core Data syncing, many developers run into hairy problems.

I've worked on many projects that involved database syncing. Those systems ranged in difficulty from relatively simple one-way syncing to the much more difficult n-way syncing. The latter, in particular, was a system that was required to be a reliable source of information from any node in the system even when not all information had been made available to that node.

In any case, I can empathize with Apple's plight. It is relatively easy to deal with the so-called 'happy path' cases (e.g. a node makes a data update, another node receives that data update). However, it is the edge cases that can be maddening (e.g. what happens if both nodes make contradictory changes? What if a new node is brought online after a long period of time of being out of sync?). For key-value and document-based syncing, things are much simpler because there is generally a clear-cut winner due to the data being relatively self-contained (and users can generally understand why one change wins out over another). For databases, however, maintaining the integrity of the data is not so simple. In the case of document syncing, the absence of a single document does not necessarily cause integrity issues for other documents in the set. In the case of databases, the absence of a single data element can result in irreparable damage to the database.

Folks, Apple's iCloud is clearly a work in progress. It works great in some cases, but it remains to be seen if the Core Data syncing will ever quite work as advertised.