I'm trying to build a web-based task management system. I want different organizations to be able to access different lists of tasks. There are two ways I can imagine going about setting up the database architecture:
- All the tasks for all the organizations are stored in a single table. Task records associated with organization X have a foreign key stored for X's ID number.
- Each organization receives its own task table. The table has a prefix to identify it as belonging to that organization. A separate table stores associations between organizations and table prefixes.
What are the advantages and disadvantages of 1. vs. 2.? Which one scales better? Also, I'm considering allowing users to turn off and on certain attributes of tasks, e.g., the ability to keep track of how much time you've been working on a task. I was imagining I could best do this by adding or removing fields from the task table. Since different organizations will have different configuration settings, though, would 2. be better suited for this purpose?