News for hackers. Stuff that matters.
Re:How the Dropbox Datastore API Handles Conflicts – Part Two by joejohnson on Friday August 30, 2013 @03:52PM (#6303825)
I might not understand what the Datastore API is for, but if I wanted to make a simple app that could sync to Word Docs between to clients, would these .doc files get represented in this database structure (tables, records and values)? Is that data structure just for example purposes?

How would this algorithm handle changes to the same text file? Is the file a record, and each row considered a value in that record?

EDIT: Looks like this API is only for "structured data like contacts, to-do items, and game state." https://www.dropbox.com/developers/datastore

Re:How the Dropbox Datastore API Handles Conflicts – Part Two by smarx on Friday August 30, 2013 @03:58PM (#6303856)
Your edit is correct. To sync files, you would use the Core API or Sync API.

(https://www.dropbox.com/developers/core and https://www.dropbox.com/developers/sync)

Re:How the Dropbox Datastore API Handles Conflicts – Part Two by joejohnson on Friday August 30, 2013 @04:06PM (#6303906)
I'd be interested to hear how conflicts are handled with those APIs.
Re:How the Dropbox Datastore API Handles Conflicts – Part Two by smarx on Friday August 30, 2013 @04:24PM (#6304002)
The API uses (optional) optimistic concurrency. So when you write a file, you can specify the expected parent revision, and if the revisions don't match, the operation will fail. If you want, you can have Dropbox instead just overwrite whatever file is present on the server or write the new file but rename it in the process (e.g. "myfile (1).txt").

This is pretty much all that's possible to do generally for files, since their structure is opaque. One of the ideas behind the Datastore API is to support developers structuring their data in such a way that changes can be merged automatically.