4

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?

asked Jun 21, 2018 at 12:37
1
  • 8
    Sharing 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. Commented Jun 21, 2018 at 12:47

1 Answer 1

9

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.

answered Jun 21, 2018 at 12:48

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.