Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The "natural key" for a (natural) person is compound: full name and mother's full name, plus date, time and place of birth. Your birth certificate is your primary identification document.

However that still runs into problems of nondurability of the key in cultures that delay naming for a few years. To name one problem.

So yeah, use a big enough integer as your key, and have appropriate checks on groups of attributes like this.

However, if you are only interested in citizens, then a "natural" key is the citizen id issued by the government department responsible for doing that. (Citizen is a role played by a natural person so probably doesn't have too many attributes.) I still wouldn't use that as a primary key on the citizen table, though.



I know someone who doesn’t know when she was born, nor who her mother is.

She doesn’t have a birth certificate.

She was born in a country that was enduring several years of brutal war.

I know another person whose national ID was changed. Systems that use national ID as primary key failed to accept this change.


That natural key isn’t guaranteed to be unique.


Depends on the universe of discourse adopted.



> The "natural key" for a (natural) person is compound: full name and mother's full name, plus date, time and place of birth.

All it would take for a Bobby Tables[0] moment is a mother to have twins delivered by caesarean and given the same name... The same name thing has already been done[1].

[0] https://xkcd.com/327/

[1] https://www.walesonline.co.uk/news/real-life/mum-gives-twin-...


> I still wouldn't use that as a primary key on the citizen table, though.

Why not?


We need a new term of art: "naive key".




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

Search: