Beware of Sync Platforms (2013)

ahmed1hsn1 pts0 comments

Beware of Sync Platforms | KS Sreeram's Blog

KS Sreeram

Blurb?

Twitter

RSS

Beware of Sync Platforms

Friday, July 12, 2013

Recently, Dropbox announced their database sync platform.

At first sight, it looked simple and clean. But I was disappointed<br>when I saw this:

Forget conflicts and combining changes when people use your app from different devices. With datastores, Dropbox can now understand the structure of your app data and automatically merge changes made at the same time. For example, simultaneous edits to a contact's phone number and email address will be merged without sync conflicts or any action from the user.

Any sync-platform that claims to perform automatic conflict resolution<br>is broken. This is because conflict resolution is fundamentally a<br>domain specific problem that cannot be magically solved by a generic<br>platform.

Let me explain with an example.

Dropbox does not consider changes to two different fields of the same<br>record as conflicting. That's a problem.

To see why, consider the following scenario:

My wife and I are going on a picnic with friends. We use a task-list<br>app with two fields per task - "task name" (a string) and "completed"<br>(a boolean) - to create a shopping list that's shared between the two<br>of us.[1]1

The list contains the following items that are yet to be completed.

12 AAA batteries

4 foldable chairs

bread and butter

dry wood for fire

Once an item is completed, it is moved off the list and displayed in a<br>separate section.

Let's say my wife realizes we actually need 5 chairs, not 4. She goes<br>ahead and changes "4 foldable chairs" to "5 foldable chairs". She<br>happens to be offline when she makes this change, and hence this<br>change isn't visible to the server immediately.

At around the same time, I buy the 4 chairs. I go to the app and look<br>for the item "4 foldable chairs" and mark it as completed. The item is<br>moved off my list into the completed section.

Once my wife gets online, the app pushes her changes to the server. My<br>wife's change modifies the "task name" field. My change modifies the<br>"completed" field. If Dropbox were used for syncing, since the two<br>fields are independent, it would automatically apply both<br>changes. Dropbox sees that there are two simultaneous changes to the<br>same record, but it does not consider this to be a conflict because<br>the two changes operate on two different fields.

This effectively results in the item "5 foldable chairs" being marked<br>as completed.

In the context of this task-list app, Dropbox's automatic merging has<br>resulted in a situation that's akin to losing data! We did not buy 5<br>chairs, but the app makes us believe that we are done buying<br>chairs. That's just as bad as losing data.

In essense, the notion of a conflict depends on the meaning that<br>we assign to the data. Dropbox knows nothing about the meaning. It<br>only knows the shape of the data. And that's not enough to resolve<br>conflicts.

Dropbox doesn't yet allow two different accounts to share the same datastore. For now, assume that my wife and I share a common dropbox account. ↩

&copy; 2011 - 2022, KS Sreeram.

dropbox chairs changes completed sync list

Related Articles