Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Foreign Key - forcing at database side or appln side

Re: Foreign Key - forcing at database side or appln side

From: Daniel A. Morgan <dmorgan_at_exesolutions.com>
Date: Mon, 25 Dec 2000 22:08:46 -0800
Message-ID: <3A4835EE.A1C22D99@exesolutions.com>

> Hi all,
>
> Where's the best place to enforce foreign key constraints - database
> side or application side or at both places. (Only 1 appln uses this
> database).
> What are the issues if it's enforced only at the appln side, and the
> foreign key constraints are not created at the database side at all -
> issues wrt time for insertion, time for queries, possibility of losing
> database integrity, additional coding and queries required at the
> application side to enforce the constraints, etc.
>
> Thanks.
> Pradeep
>
> --
> Life can always get better...
>
> Sent via Deja.com
> http://www.deja.com/

I am of the mind that you always enforce referential integrity at the database level. Maintenance issues and error messages are problems that can be easily rectified.

But there is no other way to be sure that someone accessing the database through some other tool, or performing some maintenance functions, will not violate the system's integrity.

It also means that you can upgrade the front-end with far less cost for development and testing.

Dan Morgan Received on Tue Dec 26 2000 - 00:08:46 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US