Re: Trend towards artificial keys (GUIDs) sez my textbook...is AI next?
- From: "David Cressey" <cressey73@xxxxxxxxxxx>
- Date: Mon, 17 Dec 2007 15:51:53 GMT
"raylopez99" <raylopez99@xxxxxxxxx> wrote in message
news:3dff5f4f-fa62-4721-b887-1229ffdf1388@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Dec 16, 3:00 pm, Hugo Kornelis
<h...@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> 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.
RL
.
- References:
- Trend towards artificial keys (GUIDs) sez my textbook...is AI next?
- From: raylopez99
- Re: Trend towards artificial keys (GUIDs) sez my textbook...is AI next?
- From: Hugo Kornelis
- Re: Trend towards artificial keys (GUIDs) sez my textbook...is AI next?
- From: raylopez99
- Re: Trend towards artificial keys (GUIDs) sez my textbook...is AI next?
- From: Hugo Kornelis
- Re: Trend towards artificial keys (GUIDs) sez my textbook...is AI next?
- From: raylopez99
- Trend towards artificial keys (GUIDs) sez my textbook...is AI next?
- Prev by Date: Re: Newbie question about db normalization theory: redundant keys OK?
- Next by Date: Re: Another view on analysis and ER
- Previous by thread: Re: Trend towards artificial keys (GUIDs) sez my textbook...is AI next?
- Next by thread: Re: Trend towards artificial keys (GUIDs) sez my textbook...is AI next?
- Index(es):
Relevant Pages
|