• Steve said:

    But is overusing of identity a big problem? I tend to see most people building databases as beginning to intermediate data modelers. I'd probably include myself in that group as well, and rather than have them get confused about what a good natural key is, or building a complicated complex key, I think the default practice of just sticking a surrogate identity column on the table as the PK is a good idea. It's simple, and in the absence of knowing better, or having a reason not to do it, I think it's a good practice.

    Are we talking about a profession or a hobby?

    Steve, I'm a bit surprised at this statement from you, since you're not just another procedural developer lost in a declarative world. You've been writing this excellent newsletter for years, why are your modeling skills "beginning to intermediate"?

    Are we talking about a profession or a hobby? For some reason, DDL and DML are the two places that hobby-level skills are tolerated (even encouraged) in information systems profession.

    If a person is confused about what the natural key is (or about when there is no useful natural key, such as with individuals [assuming we can't sequence their DNA and rule out identical twins], why are they using a relational database in the first place? Put it in a file for pity's sake.

    Have you ever maintained a "database" full of meaningless pointers? The most terrifying words are "it's just a simple little database". That means "I'm ignoring the true nature of the data and trying to build a network of pointers than has no inherent meaning". Easy to write, impossible to use long term.

    Now, I write lousy Java code. I know it, and that's why I don't do a lot of it, and when I do I ask a good coder to critique it. Java folks are pretty serious fundamentalists - if you don't do it right, they rake you over the coals.

    We don't have to be nasty about it. But yes, we can insist that people learn thier profession and understand how to determine the natural keys (or determine there is no "useful" natural key or another reason a surrogate makes senses) before letting them out of the sandbox.

    Roger Reid

    Roger L Reid