Entities:
- Users
- Hotels
- Roles
Relations:
When Users are assigned to a Hotel they are also assigned one or more Roles.
Example:
Alice (USER) can be assigned to Blue Moon Hotel (HOTEL) as Head Manager (ROLE). And also can be assigned to Rainbow Hotel (HOTEL) as a Marketing Manager (ROLE) AND a Reservation Manager (ROLE).
Problem
Hotels and Users tables will the biggest ones in the DB and they will be joined very frequently. We fear that the join operations will be too costly if we insert 2 rows for Alice and Rainbow Hotel (one for marketing manager and one for reservation manager). Considering the complexity is U^2 x H^2 x R^2 we might face some problems in the long run.