RE: versioning

Hi

On 19 Sep 2014 at 09:13, Ruben Verborgh wrote:
> On 19 Sep 2014 at 01:29, László Lajos Jánszky wrote:
>> 1.) API versioning
>> 
>> Afaik by non backward compatible changes it is better to add a new API
>> root with the major version number. What about the minor, revision and
>> build numbers?

There are several strategies to avoid breaking old clients but in some cases
you can't really avoid creating a new API. The best you can do in that case
it to simply mint a different URL (it doesn't matter how it looks like) for
the new API.


>> 2.) resource versioning
>> 
>> By resource versioning there are data storage solutions (e.g. event
>> storage aggregate version) which generate a version number after
>> updating a resource. This version number should be part of the write
>> requests to prevent concurrency related issues, like overriding
>> previous updates with stale data by using PUT, etc... (It is pretty
>> simple, the server checks the resource version sent with the request
>> and if it does not equal with the current version of the resource,
>> then the server returns a proper error code, possibly 409.) Should
>> this version number be part of the hydra vocab?
> 
> While I see the need for this,
> I personally don't think it should be part of Hydra Core.
> Check out other solutions such as Memento [1].

I think this is already quite well handled by HTTP itself, namely
conditional requests: If-Match, If-Unmodified-Since headers & status 412 [2]
as well as status 428 to enforce the use of conditional requests [3]. So I
agree with Ruben, I don't think we need to add something to the Core vocab.

Can you think of an use case that can't be addressed by these mechanisms?

That being said, I agree that a short section about versioning would improve
the spec. I created ISSUE-72 [4]

 
[1] http://mementoweb.org/
[2] http://tools.ietf.org/html/rfc7232
[3] http://tools.ietf.org/html/rfc6585#section-3
[4] https://github.com/HydraCG/Specifications/issues/72


--
Markus Lanthaler
@markuslanthaler

Received on Friday, 19 September 2014 14:21:21 UTC