Let's assume we have a modular monolith architecture with 2 modules A and B both relying on two separate DB schemas. If module A needs data from module B, he will get it through a communication canal (synchronous or asynchronous), but never querying directly the DB schema of B.
However, if this decoupling is required at the application level, is it required also at the DB level?
By example, is it acceptable to have a table in schema A having a foreign key reference to a table in schema ?
If this is the case, how to identify the entities that are shared between module A and B ? I mean, does the ID(db primary keys) can be passed around between modules?
Thanks a lot