3 ms·
Email addresses are awful primary keys. Sure, it's unique. But the other main property of a good primary key is that it never changes. Email addresses change co
by jsnell 10y ago
Email addresses are awful primary keys. Sure, it's unique. But the other main property of a good primary key is that it never changes. Email addresses change constantly. People use their work or university address for personal things, and then change jobs / are laid off / graduate. Or they use an email from their ISP, and move. Or they used to use one webmail system, and switch to one with a better UI; buy their first Apple device switch to an icloud email instead of a gmail one.
It's fine to use an email address as the thing you enter into a login box. But internally you really want the user records to be keyed by something else, and just associate an arbitrary number of email addresses to that.
- zAy0LfpBZLC8mAC 10y ago> Sure, it's unique. No, it's not even unique.
- wolfgang42 10y agoIndeed, the ecommerce system at my company used to use email+password as the account identifier (because reasons) and when we tried to deduplicate we found a lot of duplicates were things like SmithFamily@isp.example.com where one account always shipped to "Laura Smith" and the other one always shipped to "Harry Smith".