Question: Do we cover service-dependent trade-offs in the book?
Frank Carver wrote:Code duplication is a really interesting topic. I've had lots of conversations about the merits (or not) of code duplication with the microservices crowd.
It's long been the generally accepted wisdom that code duplication is bad, and part of the job of a responsible developer is to minimise it. That only really makes sense in the context of a single application, though.
When you have separate applications with their own development teams or life-cycles, a reliance on shared code can cause all kinds of complications and slowdowns. It can often be much more productive to develop each separate application independently, even if that leads to duplication. In particular the aim with the microservices approach is that you should be able to throw away and rewrite any of the microservices without affecting any of the others.
This is a really nice idea, but just as with any other software development, you need to be aware of the technical debt inherent in the duplication. If a commonly-used external service changes its API or semantics, for example, then every service which uses it needs to be updated to conform. With shared code that might be an easy fix in one place, but with a system which consists of a soup of microservices, the same change may need to be made in slightly different ways in several different places, which is obviously a lot more risky and harder to test.
Márcio Belo
https://marcio.belo.nom.br
Hi Frank, in our company, we use shared libraries between projects to avoid code duplication. Such libraries are statically packaged in each microservice. It does create a dependency that should managed when such library has to be modified (versioning is mandatory), not to mention the lack of a central responsible team to manage the issues. What do you think about that corporate strategy to deal with sharing code?
In time, i'm looking forward to read the book.
Often the most important part of the news is what they didn't tell.
I have a knack for fixing things like this ... um ... sorry ... here is a consilitory tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|