Let's consider such case:
Now given the circumnstaces above, I want to implement a system in which each company (tenant) has a separate schema for its tasks, but the problem is that for each task I also need a user data from the main schema.
The question is how to approach this problem
The possible solutions I have thought of (but none is really convincing me):
I hope there is a better solution I haven't thought of. Please note that this is a simplified case, just to describe the problem.
It sounds like you want a handful of tables, like users
, companies
, tasks
, and related tables.
In general, you do not want to split entities across multiple tables. Here are some reasons.
There are some rare circumstances where it makes sense to separate data. For instance, if the application is going to be on-premise at each company, then you have no choice. Similarly, you might have legal requirements for keeping data physically separate. But from a strict database-design perspective, you want one table per entity.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.