If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > Integrity on large sites

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-24-07, 11:37
naz naz is offline
Registered User
 
Join Date: Jul 2003
Posts: 18
Integrity on large sites

I'm working in a project at the moment that is using MySQL, and people keep making assertions like this one:

"*Really* big sites don't ever have referential integrity. Or if the few spots they do (like with financial transactions) it's implemented on the application level (via, say, optimistic locking), never the database level."

A large DB working with no RI would give me nightmares. Is it really true that large sites turn RI off to improve performance? Am I just being naive in thinking that everyone runs their DBs with RI in production?
Reply With Quote
  #2 (permalink)  
Old 05-24-07, 13:11
blindman blindman is offline
World Class Flame Warrior
 
Join Date: Jun 2003
Location: Ohio
Posts: 11,726
No. Don't talk to those people any more. They are idiots.


It is not true that really big databases do not use referential integrity.
What is true is that really bad databases do not use referential integrity, and some of them happen to be big databases.

And implementing referential integrity at the application level is a recipe for disaster.
__________________
If it's not practically useful, then it's practically useless.

blindman
www.chess.com: "sqlblindman"
Reply With Quote
  #3 (permalink)  
Old 05-24-07, 13:21
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
come on, blindman, don't hold back, tell us how you really feel

__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #4 (permalink)  
Old 05-26-07, 02:05
loquin loquin is offline
Super Moderator
 
Join Date: Jun 2004
Location: Arizona, USA
Posts: 1,797
Quote:
Originally Posted by naz
"*Really* big sites don't ever have referential integrity. Or if the few spots they do (like with financial transactions) it's implemented on the application level (via, say, optimistic locking), never the database level."
naz, my reply to two statements like these would be "What a MORONIC thing to say...
__________________
Lou
使大吃一惊
"Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
"I have my standards. They may be low, but I have them!" - Bette Middler
"It's a book about a Spanish guy named Manual. You should read it." - Dilbert

Reply With Quote
  #5 (permalink)  
Old 05-28-07, 18:15
certus certus is offline
Registered User
 
Join Date: Dec 2003
Location: Canada
Posts: 710
If you never want to store data correctly and never want to retrieve data correctly go ahead and turn off referential integrity. To turn off referential integrity is the removal of all the business rules from you business data. To bury it in applications decentralizes control and documentation of the business rules and ultimately leads to conflicts that create corruption.
__________________
visit: relationary
Reply With Quote
  #6 (permalink)  
Old 05-28-07, 22:42
sco08y sco08y is offline
Registered User
 
Join Date: Oct 2002
Location: Baghdad, Iraq
Posts: 697
Quote:
Originally Posted by naz
"*Really* big sites don't ever have referential integrity. Or if the few spots they do (like with financial transactions) it's implemented on the application level (via, say, optimistic locking), never the database level."
The best response to something like this is to throw what they just said back at them.

"So the big sites *do* have referential integrity, but it's not documented in a single place and it's applied inconsistently. Thus we get the worst of both worlds: all the potential drawbacks of referential integrity (having to update in a certain order, locking and unlocking) with none of the guaranteed benefits."
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On