Question

I'm reading about microservices, and one point I come across repeatedly, is, in order to achieve full indepencency, it's a bad idea to share libraries among microservices. Examples are here and here.

But how do open source libraries fit into this image? Can I use Apache Commons or Guava? If I'm using Apache Commons Lang in multiple services, would that mean I create dependencies, opposing the aim of a microservices architecture to create independent services?

Was it helpful?

Solution

It's about libraries created by you to share common functionality when you're trying to avoid rewriting the same code in your multiple microservices. It creates a situation where you have a (loose) dependency between the microservices through the shared library.

This can create problems such as needing to modify the shared library to satisfy a requirement for one microservice, whereas the other microservice will not expect this new functionality and may break.

It has nothing to do with using third party libraries in your microservices.

Licensed under: CC-BY-SA with attribution
scroll top