Hacker News new | past | comments | ask | show | jobs | submit login

> Of course it has to be a natural key! Are you expecting that users will learn your theoretically perfect surrogate key?

I'm not sure why users should ever need to know the key.

> Because shared email accounts break the many to one relationship on mail <-> person?

No, I probably wouldn't even both with addressing the problem of shared email accounts (which would require some discriminator), but with one person having multiple email accounts and email accounts changing over time. These things indicate that accounts should have transitory, one-to-many relationships to email addresses, rather than email addresses serving as a key.




«These things indicate that accounts should have transitory, one-to-many relationships to email addresses, rather than email addresses serving as a key.»

The only requirement for the email to be a key to the account is the association of one email to one person. A person can have more than one email, at different times or at the same time. The only thing that can't happen is one email mapping to two individuals. Full circle: the majority of emails do map to one individual and the cases where they do not map, are not enough to preclude the use of emails as keys.

Perhaps the confusion occurs because you think I'm defending email as a primary key for the account. I'm not. It's one key, not the primary key.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: