Re: Trend towards artificial keys (GUIDs) sez my textbook...is AI next?
- From: Bob Badour <bbadour@xxxxxxxxxxxxxxxx>
- Date: Mon, 17 Dec 2007 12:02:04 -0400
raylopez99 wrote:
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.
Hugo, keys are logical constructs. I fail to see their relevance to physical design.
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.
RL
Ray, there is no simple rule. The design criteria for keys are: simplicity, familiarity, stability, uniqueness, irreducibility.
You would do yourself a favour by writing them on a post-it note right about now.
Sometimes they conflict and one has to make tradeoffs. The ideal key will have all 5 of those properties. Sometimes no such ideal key exists. At such times, one must understand why each of the above properties is important and what problems will ensue from not having the property.
Sometimes it is possible to invent something that has all of the above properties. For example, when an employer assigns a number to every employee, prints it on a card and tells each employee to include their number on all correspondence, the employer is inventing exactly such a key. Employers were doing that long before computers arrived.
I am not exactly sure what you mean when you say "GUID". If you mean a 128 bit number encoded in hexadecimal and broken into fields, such a thing is neither simple nor familiar to anyone.
.
- Follow-Ups:
- 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: Newbie question about db normalization theory: redundant keys OK?
- 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
|