views:

31

answers:

2

I'm building a system that has a user table and a project table. I'm trying to determine the most efficient way to connect users to a project.

I'm was thinking about a table that records the relationship, but I wasn't sure if a serialized list in one field would work just as well.

+1  A: 

A join table (e.g. UserJoinProject) would be my preference and would be well normalized. Assuming you have an ID column as a primary key for projects and for users.

Serializing the list will make it difficult for mysql to do any kind of operation on that data.

mopoke
Okay that makes sense. I just wondered about the size of a db that contains many relationships
Tim
Size shouldn't be an issue in terms of storage and you're unlikely to save much (if any) by keeping the relationship in one of the other tables.
mopoke
A: 

If it is many to many relationship then you can create another table which just associates project id with a user id.

Srirangan
Same as mopoke, didn't see his answer as we posted same time. :)
Srirangan