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?
-
8Sharing dependency is bad if that means that when you change that dependency, you have to update multiple services. If you use a general purpose library, it doesn't matter if one microservice uses version 1 and another uses version 2.Vincent Savard– Vincent Savard06/21/2018 12:47:41Commented Jun 21, 2018 at 12:47
1 Answer 1
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.
Explore related questions
See similar questions with these tags.