Open nuthanmunaiah opened 4 years ago
The proposed solution has a limitation: if the breaking change to a service involves a change to the schema of the database owned by the service, having two version of the service will require two versions of the database schema to exist as well. While having two versions of the database schema is an acceptable mitigation of the limitation, it is likely that the data in the database will diverge. There are two possible solutions to the consequence of having two versions of the database schema.
Description
As of this moment, no service is explicitly versioned other than the version assigned to the corresponding container image that the service is packaged in. As as result, expressing dependency between difference versions of services is not possible. For instance, a recent change to the
project
service introduced a new field to the response from theproject.get
service method. As a result of this change, services that depend on theproject
service (repository
service for instance) had to be updated to propagate the change in response fromproject.get
. While breaking changes like these are unavoidable, the dependent service (repository
, in this case) must continue to be operational using an earlier version of the project service. However, the simultaneous running of two versions of a service is not possible in the current implementation because both versions of the service will be named the same (in thename
attribute of the associated Nameko service class).Proposal
A proposed solution, one that was suggested by the creator of Nameko, is to include a version in the service name.
The proposed solution may be better understood using the example from earlier. Consider two services,
repository
andproject
, withrepository
service being dependent on theproject
service. The proposed solution is described using the following hypothetical scenarios:repository
service depends on version 0.1.0-alpha of theproject
service. The service name of version 0.1.0-alpha of theproject
service will beproject@0.x.x-alpha
.1 Therepository
service will no longer useRpcProxy('project')
to define its dependency on theproject
service butRpcProxy('project@0.x.x-alpha')
.project
service requires a breaking change (like in Issue #31), the new version of the service will have its name beproject@1.x.x-alpha
. Since the new version of the service will be packaged in its own versioned container image, it can be run in parallel with its earlier version. When therepository
service is ready to migrate its dependency on theproject
service to the latest version,RpcProxy('project@0.x.x-alpha')
is changed toRpcProxy('project@1.x.x-alpha')
and the breaking changes the handled appropriately.1 Version follows the Semantic Versioning convention but
MINOR
andPATCH
components are ignored because theMAJOR
component is sufficient to communicate incompatible changes.Resources