Re: Trend towards artificial keys (GUIDs) sez my textbook...is AI next?
Date: Mon, 17 Dec 2007 15:51:53 GMT
"raylopez99" <raylopez99_at_yahoo.com> wrote in message
> On Dec 16, 3:00 pm, Hugo Kornelis
> <h..._at_perFact.REMOVETHIS.info.INVALID> wrote
> > >So, from this passage, I think the author does a good job disclaiming
> > >the slavish use of GUIDs without understanding their drawbacks, even
> > >after the author said he's a "big fan" of such GUIDs.
> > True. But in the rest of his book, he adds a surrogate key (either GUID
> > or IDENTITY) to every entity before and without considering whether one
> > is needed. I believe that logical design should be done completely
> > without surrogate keys. They MIGHT be introduced during physical design,
> > but not before.
> OK I'll keep this in mind when trying to architect a database system--
> use natural keys. Which is easier said than done: how unique is
> anybody nowadays ('hair color, height, weight, name, shoe size') with
> 300M Americans and 9B people on the planet? I'm not sure even a GUID
> is 100% safe with those big numbers?! Maybe we need biometrics. But
> I guess most databases are not designed to be so scalable anyway, so
> perhaps natural keys are indeed the best bet.
In another topic, the distinction between "natural", "artificial", and "surrogate" keys is being discussed. See that discussion for details. For your purposes, you can take a key as one of the "givens", even if it's really artificial.
(If you were to take the Latin word "data" and translate it anew into modern English, the word "givens" might come close.)
The problem with using keys that somebody else gives you is that it isn't
under your control.
If somebody uses the same key twice, or a user enters the wrong value for a key at initial insert time, you can be hurt by that in ways that a GUID make it easy to recover from.
But, overall, I'm going to side with the folks who say that GUIDs add completxity without adding power. There are exceptional situations, but if you're looking for the general pattern, this is it.
Received on Mon Dec 17 2007 - 16:51:53 CET