For example, I have a project which has 4 micro services: client-web, admin-web, client-api, admin-api.
These four micro services should share one DB code, should I make the DB code as a submodule of git and use it in each micro service?
does it against micro service principle?
I think you should be careful making a shared library and include it in your microservices because it can give you a point of coupling, meaning that if you have to make changes to the library, you might have to change all your services, and then you loose one of the benefits of this architecture -deploying small services without deploying the whole application.
I think a better approach is to make it a microservice on its own.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With