2

I am making an application in which users may create their accounts. I make user email as primary key in user's table. Is this technique is really bad technique? Should I create auto increment integer as primary key?

Ibtisam Tanveer
  • 107
  • 1
  • 10

1 Answers1

7

Yes, it is a terrible idea. An email is something long (so your key is longer than necessary), and it isn't immutable. I've changed at least three emails in the last ten years (providers closed).

xanatos
  • 109,618
  • 12
  • 197
  • 280