Is it possible to design a microservice based architecture on which each microservice have separate independent database and a common users table?
It is not recommended to share a database or a table between microservices. They should have distinct, well defined responsibilities and should communicate only using the network; the protocol must hide the technology used inside a microservice: for example you can use JSON for request/responses.
The reason you do this is that a microservice should not depend on the tehnology of another microservice as microservices should be easily replaced with other microservices that use other technology stack but fulfill the same purpose.
If you need data from one microservice in another you can make a:
synchronous call: this is easier to implement but is susceptible to cascade failure
asynchronous call: harder to implement but leads to a more resilient system
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