Best Practice: Versioning REST API

1) When we should do the Versioning of API

Versioning (REST) API is often a last priority during development process. In fact it should be the foremost for Designing an API, which provide the ease of consumption and usability to the end users.

2) Why Versioning become Mandatory

In the following scenario,versioning become mandatory:

1) How you response the Issues/ Feedback, your API user facing/providing after release of the API?

2) How you will manage if your endpoint not needed at all?

3) How you manage if the POST method in your API, need more key?

4) How you manage if your API keeps evolving, as the business get expanded?

5) How you manage if the semantics keep changing due to business evolution?

3) How To do the Versioning

These days the three most popular ways are following:

a) URI Versioning: It also know as route versioning.

i) Endpoints: /<API-Version>/<Path>/<sub-path>/<content>

Example: /v9/sbp/live/videoconf

ii) Pros: Most popular and easy.

iii) Cons: Polluting the URI, due to increment in the length.

iv) Company who using mostly: Twitter.

b) Custom header versioning.

i) Endpoints: /<Path>/<sub-path>/<content>

Example: /sbp/live/videoconf

Accept-Version: v9

ii) Pros: Specify the version of the API, and the server can respond appropriately with the correct response data as well as parse the incoming payload on the fly.

iii) Cons: Increasing the overall latency, as each time server have to parse the header prior to send the response.

Unnecessary forcing user to send the custom header.

iv) Company who using mostly: Microsoft.

c) Query Paremeter Versioning.

i) Endpoints: /<Path>/<sub-path>/<content>/?version=versionNumber

Example: /sbp/live/videoconf/?version=v9

ii) Pros: Ease in use and more dynamic.

iii) Cons: Cache issue.

iv) Company who using mostly: Amazon.


********** The END *****************




要查看或添加评论,请登录

Arun Dhwaj的更多文章

  • Data Flow Diagram (DFD): Brief Tutorial

    Data Flow Diagram (DFD): Brief Tutorial

    1) How to create it Step1: Start with definition and purpose. Step2: Explain components with symbols.

    1 条评论
  • Translation of Work to ROI

    Translation of Work to ROI

    Why Translate Your Work to ROI ( Return On Investment) ? 1) It will make easy for you to show your stakeholders, about…

  • Sr. Architect/ Solution Architect Responsibility

    Sr. Architect/ Solution Architect Responsibility

    I) A brief dive of Responsibility 1) Understand the System’s Requirements, 2) Understand the Non-Functional…

  • 7 Tips for Optimising System Performance

    7 Tips for Optimising System Performance

    Step-1:Measure most of the things as much as you can. Step-2: Prioritise based on outcome vs intake/ Cost ( Money/…

  • Great Leader creates DNA/Culture

    Great Leader creates DNA/Culture

    They took the following steps to creates: 1) Routine The purpose of Routine is to creates The Sense of Community and…

  • Leadership: Remotely Leading the Team

    Leadership: Remotely Leading the Team

    1) Be Output Oriented Instead of inputs, be output oriented. Explain the team, they would like to see these…

  • Be on the TOP of the WORLD

    Be on the TOP of the WORLD

    1) Be a Constant Learner Make a habit of learning, learning and learning. There is no alternative to a constant…

  • Troubleshooting/ Debugging: Kubernetes Pods

    Troubleshooting/ Debugging: Kubernetes Pods

    1) Background 1.1) Throughout we will use kubectl command-line utility to interact with K8S.

  • React: Demystifying Component, Props, and State

    React: Demystifying Component, Props, and State

    ******************* 1.0) Part-1: Component - Start ************************* What is React Component? Background: In…

  • Java: Stopping Serialization and Deserialization

    Java: Stopping Serialization and Deserialization

    There are scenario/ situation where we want to avoid our class to be serialized or deserialized. Like: our class is a…

社区洞察

其他会员也浏览了