Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Foreign Key - forcing at database side or appln side
> 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