I’m implementing a software based on the micro-service architecture using Spring/Java. Each micro-service connects to either a PostgreSQL or a MongoDB database. Is it standard practice to have a shared module that contains database-agnostic components (e.g. entity classes, models, and common repository/service interfaces used by both databases) and then have two other shared modules (one for Postgres and the other for MongoDB) importing the first shared module and implement database-specific implementation of those common components?
Amirhosein Al is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1