suresh suresh - 3 months ago 7
reST (reStructuredText) Question

Restful versioning

In Restful or any application versioning i See that versioning is done by adding version to URL of the endpoint


http://app/api/customers/1234

http://app/api/v3/customers/1234

http://app/api/v4/customers/1234


Does it mean that app is deployed in different server and all three are maintained or how it is achieved.

Answer

It depends. It may be handled twofold:

  1. Via the proxy server (e.g. nginx, apache) using the domain.

In this scenario proxy server recognizes the URL and using the version part of the domain decides where to forward the request. Basically, as far as I know, if the version is located in the path (e.g. http://app/api/v3/customers/1234) this scenario is rarely used. It's used more often if version is located in the domain (e .g. http://v3.app/api//customers/1234)

  1. In the application itself.

Application exposes all the endpoints and handles the version resolution internally.

No matter how it's handled you still need to synchronize the resources internally - in DB e.g.

Comments