General discussion

Locked

Foreign Keys

By donsw ·
I have one person who contends that adding all of the foreign keys in a database will slow down the system. This will mainly be due to adds and updates. Another person says that the db is the place to add the Fkeys since someone has to enforce the issue anyways. When adding records or udpates someone has to check the validity anyways. What is the given datbase standrad for MSSQL and Oracle we use both.

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by ezann In reply to Foreign Keys

I assume the argument is whether to enforce foreign keys at the app vs db level. I would say the "standard" is to enforce a foreign key at the DB level.

1 - It's part of what DB's do
2 - If data is modified outside of the app, the constraints will still be applied.
3 - Most commercial DB apps I have experience with use DB foreign keys.

Collapse -

Concurrence

by DPJ In reply to

I concur with ezann's comments. Keep in mind that you may have multiple interfaces to a DB; ie, Web and VB. This is a lot of extra work and like ezann stated, this is the DBA's responsibility, as is the same for the DB.

-Don

Back to Software Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums