Product Versioning Microservices

10,980

Solution 1

Micro Service Versioning

First of all ensure Semantic Versioning (SemVer) is strictly followed by the micro services. Not doing this will sooner or later lead to incompatibility problems.

Capture only API changes in that version, don't mix it up with micro service internal versioning (e.g. DB schema versioning for a service that has a DB).

Product Versioning

Introduce a version for the product as you already suggested. Following SemVer makes sense here, too, but may need to be loosened to meet marketing needs (e.g. allow to make a major version increment even though SemVer would require only a minor version increment). In extreme cases, use dedicated "technical versions" and "marketing versions". This is however more complicated for the customers, too.

Also note that you will need to define what the SemVer version means in terms of your application, since the application as a whole has no "API".

Dependency Management

Now a specific product version is a list of micro services of specific versions. Note that this is essentially dependency management in the same sense as apt, npm, bower, etc implement. How sophisticated your solution needs to be is difficult to say, but I recommend to at least support the notion of "minimum required versions". If docker has a built-in mechanism, try to use that one (I don't know docker very well, so I can't tell).

With this, you are e.g. able to specify that your product at version 4.8.12 requires service A at version 1.12.0 and service B at 3.0.4.

The update mechanism should then follow a strategy that adheres to SemVer. This means that installing a specific product version automatically installs the newest services with the same major version. In the example above, this could e.g. install 1.12.2 of service A and 3.3.0 of service B. Providing a mechanism to keep already installed services that meet the dependency requirement may be a good idea, so that users don't get annoyed by the update mechanism.

Solution 2

Literature uses a 5 dimensional model for this:

  • version (wanting to change)
  • status (life cycle: create, test, deploy, retire)
  • view (source, deployment, documentation)
  • hierarchy (product, microservice)
  • variant (largely similar, describing the differences, product families)

Most systems only handle a few of these dimensions. To handle all five, you have to describe (fix) your development process.

When only looking at version plus hierarchy, as you do here with product and microservice versioned separately: product version should change as soon as users of the product can notice something different. You might want to signal that from the microservice versioning by using major-minor numbering: minor should not affect the product version, major should. Or you could use version ranges/semantic versioning.

The reference:

Managing design data: the five dimensions of CAD frameworks, configuration management, and product data management. van den Hamer, P. Lepoeter, K. Philips Res., Eindhoven;

This paper appears in: Proceedings of the IEEE Publication Date: Jan 1996 Volume: 84, Issue: 1 On page(s): 42-56 ISSN: 0018-9219 References Cited: 26 CODEN: IEEPAD INSPEC Accession Number: 5175049 Digital Object Identifier: 10.1109/5.476025 Current Version Published: 2002-08-06

Share:
10,980

Related videos on Youtube

Dariss
Author by

Dariss

Updated on June 14, 2022

Comments

  • Dariss
    Dariss almost 2 years

    I go into microservices architecture based on docker and I have 3 microservices, which together create one product for example "CRM system".

    Now I want my client to be able to upgrade his product, whenever he wants to. I have 3 different versions of my microservices, which one should client see? I guess product version should be independent of microservices, because copying one of the microservices version would make me go into more trouble than having no version at all.

    So is there any pattern, idea to handle such situation?

    The only thing that comes to my mind is to have another repository which will be versioned whenever one of the microservices will produce production ready package. However, I now have a version, which none of my Product Owners (PO) would ever know about.

    • Will C
      Will C over 8 years
      What do you mean by upgrading the product whenever he wants to? Are you referring to something like a desktop application or a mobile application in which you're not requiring them to update thats causing problems with regards to adding additional features or evolving the API message schemas?
    • Dariss
      Dariss over 8 years
      Yes I was talking about desktop application, which has upgrade system module. It does allow administrator (Client), to upgrade his system with one button click. Application goes down for awhile and background task do it job, to fulfill the request.
  • ferr
    ferr about 7 years
    I think there's a point missed in the OP's question. He is asking "If I have 3 microservices, each with their own version eg v1.0.0 v1.2.1 v1.3.0 how do I describe the product version when I go from v1.0.0->v1.1.0? Should there be an independent version for the overall product which has these 3 microservices? Should that also use SemVer?"