Saturday, September 30, 2023
HomeGolangDependency dealing with for microservices with Golang: monorepo vs multirepo

Dependency dealing with for microservices with Golang: monorepo vs multirepo

Microservice structure is legendary these days, nevertheless it has some drawbacks, see my earlier article: Microservice structure isn’t a silver bullet. One of many painful complexity is dealing with the part model dependency.

The part model dependency is greater than part dependency, as a result of it specifies which model is used on the dependency. Dealing with this extra data makes a number of headache for the engineers.

The parts are developed by completely different groups and it have completely different model numbering and launch dates. It’s onerous to comply with and discover the great setup of the part variations. One part can have extra referrers which can count on completely different variations. Let’s have a look under easy system:

Fig. 1: A dependency cycle (from Robert C. Martin: Clear Structure)

5 parts refers to Interactors part. In splendid world the referrers count on identical Interactors model. However in the true world, the referrers are examined with completely different model of Interactors or a brand new model of Interactors introduces a non-backward-compatible change, however not all referrers are up to date to assist this transformation. It’s onerous to determine, can a referrer use a more recent referred part model with out testing it collectively.

One other drawback is, the inter-component dependency have to be outlined with model in supply code at implementation time and within the deployment config at deployment time, see a quotation from Chris Richardson: Microservices Patterns:

In a microservices-based utility, altering a service’s API is much more tough. A service’s purchasers are different companies, which are sometimes developed by different groups. The purchasers might even be different purposes outdoors of the group. You often can’t drive all purchasers to improve in lockstep with the service. Additionally, as a result of trendy purposes are often by no means down for upkeep, you’ll usually carry out a rolling improve of your service, so each previous and new variations of a service can be working concurrently.

It’s onerous to maintain in sync the model dependencies between two parts at completely different locations and time (within the supply code throughout implementation and in config information throughout deployment) to be able to have the anticipated variations runtime (course of view).



Please enter your comment!
Please enter your name here

Most Popular

Recent Comments