When saving data in different sql tables, is it best to use the GUID userID or simply use the username? is there a performance difference when using guid?
+10
A:
Use the guid. It is the system internal identifier for your users. This then allows the ability to change usernames if people wish.
This then fits nicely with the concept of an internal ID that means something to your system, versus the external ID that means something to your users.
Neil Barnwell
2009-01-24 23:49:21
No only that, but user names can be changed and/or duplicated IRL.
Josef
2009-01-25 02:33:10
It sure seems the correct way, but why isn't it accessible ...User.Identity.? I am trying to understand why it was done the way it was.
Brettski
2009-04-02 03:11:00
+4
A:
I saw a lot of discussions about performance in GUID vs. INT (auto increment). But I could recommend you use GUID.
Hm.. Are you asking about field used as primary or about using/not a relations (insert a GUID into a table having another table with GUID and user name associations) ?
abatishchev
2009-01-24 23:57:15
primary in the Users table as guid. reference field in other tables (as guid or not)
zsharp
2009-01-25 00:41:55
GUID vs Int is more regarding the clustered index of SQL Server. A monotonically increasing value (identity integer) is preferred for the Clustered index, regardless of the primary key.
Josef
2009-01-25 02:34:07