1.

How to handle versioning of microservices?

Answer»

There are different ways to handle the versioning of your REST api to allow older consumers to STILL consume the older endpoints. The ideal practice is that any nonbackward compatible change in a given REST endpoint shall lead to a NEW versioned endpoint. 

Different mechanisms of versioning are: 

  • Add VERSION in the URL itself
  • Add version in API request header 

Most common approach in versioning is the URL versioning itself. A versioned URL looks like the following: 

Versioned URL 

  • https://<HOST>:<port>/api/v1/...
  • https://<host>:<port>/api/v2/...

As an API developer you must ensure that only backward-compatible changes are accommodated in a single version of URL. Consumer-Driven-Tests can help identify potential issues with API UPGRADES at an early stage.



Discussion

No Comment Found