Re: Should I use database foreign keys and indexes

From: JRStern <JXSternChangeX2R_at_gte.net>
Date: Wed, 10 Jul 2002 22:41:26 GMT
Message-ID: <3d2cb791.29465439_at_news.verizon.net>


On 10 Jul 2002 14:13:46 -0700, carl.stottlemyer_at_lmco.com (Carl) wrote:
>I recently had a discussion with several web application developers
>where I work about the use of foreign keys and table indexes.
>
>I always thought that they were both basic elements of relational
>database modeling and should be included in all of your database
>designs. I was suprised that they felt that foreign keys and indexes
>add unnecessary complexity to a database and that they never use
>foreign key constraints and rarely use indexes as a primary key. I
>would like to know your thoughts on using foreign keys and indexes in
>a database.

Most web designers are idiots, thanks in large part to Microsoft.

The standard Microsoft recommendation for app architecture over the last few years has been to analyze your application in terms of objects, put them in the middle tier, and use the database to persist them into basically flat files. I see this all over, and am amazed that such bad advice is given or followed.

Generally, it's faster and easier to do the analysis and implement it as a data model. That typically leaves about a third of the logic still to do in the middle tier. How many times do I see "application architects" writing middle-tier code to do a join that the database could do for them?

Out of curiosity, what's your background, that you're asking this question, now?

J. Received on Thu Jul 11 2002 - 00:41:26 CEST

Original text of this message