DEV Community

Alexsandro Souza
Alexsandro Souza

Posted on • Edited on

Are you starting with microservices? Forget the DRY principle and embrace redundancy!

I am always posting provoking post on my Linkedin, and I have decided to replicate those here. Let's socialize!

Are you starting with microservices? Forget the DRY programming principle and embrace redundancy!

Extracting common code to a library seems to be the best practice. However, if two microservices share a library, they are coupled and not independent anymore.

That will increase the coordination effort, and a trivial change in the library will become very hard because it has to be coordinated among the microservice teams.

Someone may suggest adding versioning; then it will add restrictions and may lead to painful version conflicts.

Developers will fear adding improvements and refactoring the code because they will not know how their changes can affect other microservices.

Accept redundancy. It's ok to have redundancy to stay independent. This way, we will avoid technical and organizational coupling, speed up the development and enable modernization.

You can find more here

Top comments (0)