Quick question about database design.
If I have two databases: User_DB and Group_DB, and User_DB contain a table named User_TB and Group_DB contain a table named Group_TB. This is a many to many relationship so User can belong to many Groups and a Group can have many Users. So there is an associative entity between them UserGroup. Where should this table be placed? In the User_DB or Group_DB?
Assuming there is a valid reason for having two separate databases, I would be inclined towards keeping it in the database that ‘owns’ the relationship – the answer would differ based upon how the entities and relationships are defined in the problem domain, and probably would be subjective.
In this case Users belongs to Groups – this relationship is leaning heavily towards users instead of Groups and hence I would be inclined to keep the mapping in User_DB.