Re: [Specifications] Question about resource versioning (#190)

I gave it some thoughts and I feel that we need to clarify a few things. ReST is about representation of the resource, thus each resource behind an URL should be treated as it is - a resource, some kind of state.

When working with separate items of a given collection I think there are no issues here - each item will have it's URL and an ETag that should help you detect conflicts. Agent A edits a resource 1 with ETag X and Agent B edits same resource 1 with ETag X. Agent B updates a resource 1 which receives an ETag Y. Agent A tries to update a resource 1 but receives HTTP 409 and needs to react accordingly (override, merge, forfeit, whatever).

Working with whole collection at once makes things complicated as from resource point of view it is a coincidence that it is a collection. It is just another resource if a separate URL and ETag atteched to it. I think that server may choose to change that ETag when any of the items or the collection itself changes (i.e. order of the items in case of a list). It is also up to the server on what to provide when a collection URL is called - full representation or just a list of URL of the items or something in between.

There is no nice solution here. Pure ReST-like approach would be receive whole collection with it's dedicated ETag, modify and send it back - in case of an 409 agent should do something to resolve a conflict and that's all. But this approach may involve large payloads.

Other approach would be use some kind of PATCH-like approach, but this goes somehow outside of pure ReST and protocol knowledge and client/agent may need to understand more.

Another approach would be to use something like hydra to inform a client on how to proceed via links and operations available and some meta-data that are not provided by raw hydra (i.e. resource version mentioned). I believe there are vocabularies that provide these kind of meta-data (i.e. DCTerms) but this requires a client to understand even more.

-- 
GitHub Notification of comment by alien-mcl
Please view or discuss this issue at https://github.com/HydraCG/Specifications/issues/190#issuecomment-735406110 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Sunday, 29 November 2020 14:49:10 UTC