I have two modules(mod1 with DB1 and mod2 with DB2) hosted as micro services. Both modules have some common functionality which can interact with DB1 and DB2 both.
Approach_1 :- Make another mod3 as shared library jar for common component and inject it in both modules to avoid duplication of code
Approach_2 :- Make another micro services for common component instead of shared library jar.
Not sure which approach is better in term of design and what criteria I need to consider here ?
Per my understanding It should be shared library instead of microservice as it will interact with multiple DB. If it is shared jar, that module logically lies with caller module business wise.
Aucun commentaire:
Enregistrer un commentaire