First, I appreciate the discussion in this thread as this is all new to me.
> What use cases should we support first?
I'd be for looking into the document use case first, and hold off with the transactional/Operational Transformation one for now. This mainly because is seems to be a lot simpler.
qmx suggested using something similar to CouchDB. CouchDB uses a revision field for each document to handle/detect conflicts.
The following is a concrete example of how this works with CouchDB:
Create a database:
{"ok":true}
Get a uuid:
{"uuids":["f11075199bcea80849204660d7000d53"]}
Create a car object(document) using the above uuid:
{"ok":true,"id":"f11075199bcea80849204660d7000d53","rev":"1-dffbd1dbd1b9ecbffc1b02a34cbaea0b"}
Notice that the server returned a new document revision.
Now clientA updates the car object, notice that we are specifying the document revision:
{"ok":true,"id":"f11075199bcea80849204660d7000d53","rev":"2-588a9da2e252e9a3d2fc0634610a0c25"}
Also, notice how the server returned a new document revision.
Now, clientB still has the old revision and tries to update the car object:
< HTTP/1.1 409 Conflict
{"error":"conflict","reason":"Document update conflict."}
This conflict would the have to be handled by the client. Could we start out with something similar and as simple as this and evolve it?