4 ms·
I am sure you can also get autofill to get the email address correct on popular devices for most people, therefore making the process fairly frictionless. Plus
by Theodores 10y ago
I am sure you can also get autofill to get the email address correct on popular devices for most people, therefore making the process fairly frictionless. Plus email address is a very good primary key.
- jsnell 10y agoEmail 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".
- nommm-nommm 10y agoEmail addresses are a terrible primary key. They change (and they change a lot). They are longer than strictly necessary. A related problem there isn't a one-to-one mapping between email address and person, one person can have several email addresses. If you want to let a person have many accounts and keep track of which accounts a person has (like ebay does) then you're going to need a person primary key too and can't make an assumption about email = person. Its my opinion natural primary keys should be used very, very sparingly if at all. There's basically no "person" natural key. Even social security numbers are subject to various problems when used as primary keys. SSNs can (rarely) change. Laws and policies around SSN use and storeage also change.