Azure API Management - Revisions vs Versions

A lot of us would already be familiar with Azure API Management and might already be using it extensively as a gateway for our backend services.

"API Management (APIM) is a way to create consistent and modern API gateways for existing back-end services. You can use Azure API Management to take any backend and launch a full-fledged API program based on it." - Official Microsoft Documentation

It is fairly easy to set-up and get started. But then over time, when the backend services or API goes through evolution, arises the need to have continuity while at the same time being able to make available updated APIs and/or backend services.

If you are not familiar with Azure API Management, I recommend reading the Official Microsoft Documentation.

Microsoft announced the public preview of "Versions and Revisions in Azure API Management" on September 14, 2017. 3 years later, I see that there are still quite some questions on the effective use of these features in a lot of enterprises.

In this blog, I have tried to put together a strategy to handle this based on information that I have gathered from Microsoft Official Documentation and blogs. Of course this is completely my understanding and view of using these features. I am eager to also know and understand how others handle this to augment my understanding or maybe completely change it.

Let us first understand what is meant by Revisions and Versions and then try to understand how they can be used in the flow of rolling out changes to your APIs.

Firstly, Versions and Revisions are two distinct , yet related, features.1

What are Revisions?

Revisions allow you to make changes to your APIs in a controlled and safe way. When you want to make changes, create a new revision. You can then edit and test API without disturbing your API consumers. When you are ready, you can then make your revision current – at the same time, you can post an entry to the new change log, to keep your API consumers up to date with what has changed.1
  • Revisions are changes/improvements/fixes to the current available API i.e. non-breaking changes.
  • Revisions allow to safely make changes to your API Management API definitions & policies, without disturbing your production API.
  • Revisions allow to try out changes before publishing them.
  • After testing, 
    • A new Revision can be set as current i.e. published. Thereafter, the new revision is available to callers of API.
    • Rollback if you find issues.
  • Notes/descriptions about changes made in a Revision can be published to Public Change Log of the API.
  • This information is available in the developer portal and acts as change-log that developers can refer/use.

What are Versions?

Versions allow you to present groups of related APIs to your developers. Versions differentiate themselves through a version number (which is a string of any value you choose), and a versioning scheme (path, query string or header).1
  • Version is in fact a new API based off an API's revision.
  • Every version gets a new name that must be unique across API Management instance.
  • Versions allow to publish multiple versions of your API at the same time.
  • Versions can introduce major changes that can be seen as breaking-changes.
  • Versions can be seen as new APIs which can
    • use path/query string or header to differentiate between versions.
    • use any string value you wish to identify your version (a number, a date, a name).
    • be associated with different products.
  • Show your API versions grouped together on the developer portal.

Revisions vs Versions


Each version can have multiple revisions, just like a non-versioned API. Should you find that your revision has breaking changes, or if you wish to formally turn your revision into a beta/test version, that is also possible.

Now that we have an understanding of what they mean and how they can fit into the plan of things, it might also me meaningful to try and list scenarios where Versions and Revisions fit - when to use what?

When to use Revisions?

  • When you need to fix/add/update your current API without disrupting the callers i.e. make non-breaking changes.
  • Such changes can be Policy Changes, Addition of new operations, etc.
  • You can only support and expose one Revision at any one time.

When to use Versions?

  • When you want to introduce a breaking change to your API and deploy it as a new API with a new URL.
  • When you have different versions of URL intended for different audiences/Products.
  • You also want to support all/more than one such deployments – old and new.

Text Quotes

References:


Comments

Popular posts from this blog

Automate Import of Functions/WebAPI in Azure API Management as backend and using OpenAPI definition and Terraform

Transcripts with Microsoft Bot Framework v4

Managing built-in cache in Azure API Management