Nice article. I'm new to micro-services, and I've never develop on a micro-service. However, I'm under the impression that micro-services, in a way, might lead to violate the DRY principle... Since the services are separated, some concerns are the same however, it seems to me that it might lead to some code that will be the same (or very very similar) between the different services' source code... Or am I missing something ? EDIT: but I guess it depends at which level the separation of services is done.
Duplication is accepted and expected in µservices.
Although nothing is stopping you from publishing libraries for the common code. A purist would scoff at this though since they would say you should just have a µservice that performs this common operation.
Regarding the code duplication, I have seen this happening in microservice projects. And of course it comes with all the disadvantages of duplicated code. Even if you would extract out some common business functionality into a library you still need to upgrade this lib and every service that consumes it when a change happens.
Of course some experts say that this is down to poor cutting / design of the services themselves. I guess it is a topic of theory vs. real world.
In practice it should be different devs or teams working on the different services and usually in different languages and environments. It shouldn't be one programmer repeating themselves. The major benefit of a microservices architecture is that it's applied Conway's law; the loose coupling between services makes it feasible for many different teams and devs to work on the same project. If you are a single developer or a small team I would not recommend it.
Makes more sense. I've always though of micro-services as one (or different, but mainly one) team of developers that was in charge of the development of the multiple micro-services. Hence my question. Thanks for the explanation !
2
u/CrommVardek Dec 12 '19
Nice article. I'm new to micro-services, and I've never develop on a micro-service. However, I'm under the impression that micro-services, in a way, might lead to violate the DRY principle... Since the services are separated, some concerns are the same however, it seems to me that it might lead to some code that will be the same (or very very similar) between the different services' source code... Or am I missing something ? EDIT: but I guess it depends at which level the separation of services is done.