Unique identifiers for users
Posted
by Christopher McCann
on Stack Overflow
See other posts from Stack Overflow
or by Christopher McCann
Published on 2010-04-08T18:15:33Z
Indexed on
2010/04/08
18:23 UTC
Read the original article
Hit count: 362
If I have a table of a hundred users normally I would just set up an auto-increment userID column as the primary key. But if suddenly we have a million users or 5 million users then that becomes really difficult because I would want to start becoming more distributed in which case an auto-increment primary key would be useless as each node would be creating the same primary keys.
Is the solution to this to use natural primary keys? I am having a real hard time thinking of a natural primary key for this bunch of users. The problem is they are all young people so they do not have national insurance numbers or any other unique identifier I can think of. I could create a multi-column primary key but there is still a chance, however miniscule of duplicates occurring.
Does anyone know of a solution?
Thanks
© Stack Overflow or respective owner