|
|
 |
Re: FN-FORUM: What's the best development platform for creating Web 2.0 business applications?
date posted 21st November 2007 21:47
Graham Stark wrote:
> The idea is, sort out what really makes a record unique (a username,
> perhaps, or a username and an order number) and use that. Let the
> database do the work for you.
I've been burnt too often before by trying to use "natural keys" as the
primary key of a table. Suddenly you find that you're importing data
from two systems that both use the same keys for different records. Or
that a system that you're importing data from reuses customer IDs once a
customer is deleted.
It's much easier to invent your own key. There's also the (admittedly
slight) performance advantages you get from always having primary keys
as integers.
By means, make the natural key into a unique index so you don't import
invalid data unknowingly. An unique index is far more easy to change
than a primary key.
Dave...
|
 |
|