i'm migrating a nTier architecture into an hexagonal one. My domain is well defined now, and I have interfaces for all infrastructure dependencies. Looking at database repositories, I have several databases and there is one class implementing each repo, in the Infra side. My question is about what should be the correct approach about DB dependency:
1- To have one interface on domain side to deal with data access and then rely on Infrastructure implementation and have there one class as entry point for all database repositories, like a facade, from where all repository implementations will be called. This approach is the same I already have in nTier application, the facade and the repos are the current Database Layers.
2- Have interfaces for each database I need on Domain side. Each interface will be implemented on Infra side to access the corresponding DB. It keeps layers thin, but this aproach add Data management logic to the Domain. The Domain should not care where the data is, the Infra should deal with this. If some data is moved to another database then the corresponding interface needs to changed on Domain side (to move the method exposing this data to another interface for example)
let me know,