Hacker News new | past | comments | ask | show | jobs | submit login

All these are good points.

However, in the case where the Id is the nature key (e.g. SSN), the Id can be known from the user input. Creating an employee is just a matter of PUT his full record along with his SSN as the Id.




Save yourself some hassle. Don't key on SSN.

1) Encryption (and then indexing) becomes harder.

2) SSN's can change, for many reasons. (eg: http://consumerist.com/2008/11/can-i-change-my-social-securi..., data entry error, etc)


It is a bad idea to use anything entered by a user as the primary key.

It is ok to use data entered by users to assure the uniqueness of a record (unique indexes/constraints).




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: