database - All my microservices have their own db's, should I create common microservice to handle connections? -


i have number of microservices maintain own databases (mongodb, elastic, mysql) , each of microservices have set-up new connection constantly.

i considering wise if created microservice, handle these connections microservices, before start up.

example: api gateway microservice gets request search, calls search microservice, before search starts, calls database setup miscroservice , returns established connection it, based on microservice called (in case - search microservice).

would better, if found out connection needed inside api gateway? or should leave logic separately in each microservice.

you break microservices encapsulation assuming type of persistence each microservice using.

each microservice should free use whatever persistence type wants or change when wants transparently, without notifying or requesting permission other microservices this.


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -