[nycphp-talk] The user table
David Krings
ramons at gmx.net
Sun Mar 6 18:46:36 EST 2011
On 3/6/2011 3:46 PM, tedd wrote:
> You won't have any "redundant" info if you use email as unique -- after all,
> email *IS* unique.
Unique yes, but it can change. You'd need to change the primary key of a
record if a user wants to use a different email address. Not sure if that is a
smart thing to do. You'd need to update all related records, which wouldn't be
necessary when using an integer as primary key that is only data and not
information.
As far as normalization goes, I represented it the way it was once explained
to me, which I do not insist on being correct. In any case, I think I got the
point across of the practical benefit of not splitting up related data across
multiple tables. There are many ways to do it and some say it is right to do
it that way, others say it is better to do it this way. In my experience the
approach I detailed is what works for us best for an enterprise product. Of
course, Celko probably calls us all idiots and has a totally different opinion
on how to do things.
David
More information about the talk
mailing list