Programmer YG
Programmer YG

Reputation: 1

Is it reasonable to rebuild the relationship between the relationship table and other tables?

The demand is this: a user belongs to multiple departments, and the roles in each department are different, and each role has different permissions.

The general idea is You need to build another layer of relationships on the relationship table. I wonder if there are other better designs

Upvotes: -1

Views: 31

Answers (1)

Jose Cabrera Zuniga
Jose Cabrera Zuniga

Reputation: 2619

Before making "super improvements" follow the "natural" strategy. If something belongs to some other thing what is the pattern you "naturally" need to use?. While exist ways to "split database tables" into some more 'simple' tables (https://www.bmc.com/blogs/canonical-data-model/) there is not a complete answer as for some db engines you might need to repeat fields to cache some info. This is typical when a server allows you only a limited number of db calls per transaction.

Upvotes: 0

Related Questions