Do large systems use foreign keys in their databases?

One of the drawbacks people face when using foreign keys in a relational database is the overhead of ensuring that the parent table exists before any insert operation is performed. ( Example ). As your database and work grows, this effect increases. Does anyone know if then they use large sites on the Internet? If so, how do they deal with this extra overhead? If not, as your development team grows larger, it looks like this can cause many potential errors / conflicts / invalid / orphaned strings.

Any insight?

+7
source share
2 answers

I work in the telecommunications sector, yes, they are often, the cost of FK is too low compared to the severity of one major incident (hours of time lost, corrections ...) that can be caused by accidents due to the lack of FK verification.

+1
source

It depends on your definition of a "big site": if, for example, Citigroup online banking is a "big site", I assume that they do it.

What I mean by this example is that the use (or non-use) of foreign keys, access only to stored procedures, etc., depends on the requirements of business logic (and, possibly, its legal base) more than from only technical capabilities.

0
source

All Articles