Re: Natural keys vs Aritficial Keys

From: Jonathan Leffler <jleffler_at_earthlink.net>
Date: Wed, 20 May 2009 23:59:01 -0700
Message-ID: <Df6dnZMSF6ohZonXnZ2dnUVZ_gadnZ2d_at_earthlink.com>


Walter Mitty wrote:
> I'm confused about some recent trends in database design.
>
> When I learned databases, about a quarter of a century ago, the preferred
> practice was to use natural keys to refer to individual table rows, unless
> there's some real good reason to go with an artificial key. I've run into a
> few cases where I chose to use an artificial key, but most of the time I've
> used a natural key. [...]

Somebody mentioned in an answer on StackOverflow that (Ruby on) Rails requires all tables to contain a column called 'id' (and, by implication, that column should be an 'identity' column or auto-generated value). (I've not verified that this is so.)

I've also seen numerous suggestions that modern web-ish environments (Rails, etc) get confused by composite keys.

In all cases, the problem seems to be a lack of understanding.

-- 
Jonathan Leffler                   #include <disclaimer.h>
Email: jleffler_at_earthlink.net, jleffler_at_us.ibm.com
Guardian of DBD::Informix v2008.0229 -- http://dbi.perl.org/

publictimestamp.org/ptb/PTB-6210 tiger128 2009-05-21 06:00:05
967144408DF12A71FE74F813A530EC74
Received on Thu May 21 2009 - 08:59:01 CEST

Original text of this message