[Specifications] Question about resource versioning (#190)

inf3rno has just created a new issue for https://github.com/HydraCG/Specifications:

== Question about resource versioning ==
I already had this question on the mailing list probably years ago. I am curious if there is any progress/recommendation about this.

When multiple persons are working on the same resource there can be conflicts. E.g. 2 authors want to edit an article in the same time. In these cases we can add 2 branches or we can resolve the conflicts and merge the edits, just like we do by git. If we don't want to support all of these features in our REST API, then we need to refuse somehow the second request and let the client solve this problem for us. In order to do that we need to detect whether the modifications are based on the most recent version of the resource. We don't even need to save the previous versions of the resource, just generate a new version id by every change of the resource. That version id must be added to out update link as input and sent back by the update operation and compared to the actual version id to decide whether the update is based on an outdated version and thus should be refused. Afaik. this is best practice currently by MongoDB to avoid conflicts and it's probably used by other noSQL databases too, but it is not a database dependent solution. I guess the best solution would be to add this resource version in a Hydra extension vocab e.g. in a `hext:resource-version` property. I'd like to know if any Hydra related project support this or if you have any input about this.

Please view or discuss this issue at https://github.com/HydraCG/Specifications/issues/190 using your GitHub account

Received on Sunday, 14 April 2019 04:22:17 UTC