Primary vs. Surrogate! What a nightmare debate.

From: Kostas <noemail_at_noemail.net>
Date: Sun, 17 Oct 2004 03:25:10 -0400
Message-ID: <10n47jojjcm9gdd_at_corp.supernews.com>



I must be reading all day on the issue and I am more confused then when I started.
I started my db's with natural keys as I initially was exposed to the theory of relational db's and wasn't just assigned the task of building something quick and dirty.
Then I reverted to surrogates for a while, and now, that I made my comeback designing some more serious systems (but still relatively small) I decided to settle this once and for good.

My idea was that I should be consistent, that is, use either surrogate or natural but not both. Well, it turns out that sometimes there just isn't a natural key good enough for a relation, and that hundreds of so called experts have extremely diverging opinions. To top that, both sides' arguments look valid.

My conclusion is that for small applications try to go with the natural key when it is readily available, but for large-scale warehouse applications surrogates should be seriously considered. At some points, this looks like a decision that has to be taken on an individual per/table basis.

I was just wondering what the tendency among you people is...since this ng has "theory" in it I am daring to guess where your vote goes to, but I had to inquire nevertheless.

Cheers!
Konstantinos Received on Sun Oct 17 2004 - 09:25:10 CEST

Original text of this message