The Lanham Factor

Balancing the Technology-Business Equation

  Home  |   Contact  |   Syndication    |   Login
  127 Posts | 2 Stories | 116 Comments | 106 Trackbacks

News

Article Categories

Archives

Post Categories

Image Galleries

BLOGS

Companies

My Articles

and the Artificial Key won.

I don't know what my problem is with artificial keys.  I am a HUGE advocate of natural keys.  My problem is, I tend to use "natural" keys where one really doesn't exist.  For some reason, I am fixated on avoiding duplication.  However, I tend forget what is an appropriate duplication and what isn't.  Take the following example:

Entity-Relationship Diagrams

What do I care if someone duplicates a URL?  I mean, really...does it matter if the same link is listed twice?  It does NOT.  Sheesh!  I am just killing myself.

So, in the end, had I conducted a little database design I would have never incurred the problem.  So the next time you see me blogging about databound controls or database design issues...please remind me to use artificial keys where appropriate.  Thanks!

posted on Monday, January 21, 2008 7:34 PM

Feedback

# re: I Fought the Artificial Key... 4/2/2008 11:29 AM Carlos Vacca
Fine. Avoid duplication. Just keep in mind that you also avoid duplication by using UNIQUE constraints.
I generally use artificial primary keys, and add UNIQUE constraint on the field(s) that represent the natural key.
So, in your example, if you consider the URL the natural key and want to avoid duplication, just add the constraint and you have the best of both worlds

Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: