Re: API versioning
Mike Kelly <[email protected]>
| Newsgroups | gmane.comp.web.services.rest |
|---|---|
| Message-ID | <CANqiZJaQm9Qv=FE5yyUDGRgWJN6RDyb5iKfUWOTnKbBrVBhCbw@mail.gmail.com> |
If you have to do it, you may want to look at versioning using a subdomain i.e: v1.api.example.com/orders that'll let you take advantage of DNS, should you need to split the traffic in the future. Cheers, M On Mon, Jan 7, 2013 at 11:39 PM, erewh0n <[email protected]> wrote: > ** > > > When versioning an API a common approach is to specify version information > in the URI. I'm curious how others have solved (or would solve) this > problem from a RESTful perspective. I'm aware of the recommendation to use > the content-type header for specifying version information, however I am > concerned that routing and load balancing features would suffer. So for > example if we versioned an API with api.example.com/orders/v1 and > api.example.com/orders/v2, it is straightforward to route requests for v1 > to one set of web servers and route requests for v2 to another set of web > servers. Facilitating this based on HTTP headers is more complex and > requires more "plumbing". This is also true in-code, where URI mapping > semantics are first-order concerns for many libraries (e.g. using Web API > or ServiceStack, etc, it is straightforward to map URIs to controllers or > contracts). > > Anyway, it would be interesting to hear other people's feedback on this > issue. > > Thanks. > > > -- Mike http://twitter.com/mikekelly85 http://github.com/mikekelly http://linkedin.com/in/mikekelly123