|
|
|
|
|
by delinka
4023 days ago
|
|
I've experienced several highly-performant, correct databases with concurrent clients from around the globe ... and they had no enforcement of foreign keys. Yes, foreign keys were essential to data correctness. No, they were not being enforced in production. Stew on that just a bit. Not enforced in production. During client application development, development databases enforced the constraint. Any errors resulting in foreign key mismatches disqualified the client app for release. The applications were required to be aware of the constraint and to learn to work within it. Production gained the speed benefits of not having to enforce the foreign keys. You can indeed eat your cake and have it, too, iff you are disciplined. |
|
It is very common to have many applications, from different vendors and from different time periods interacting with a database.
It often also happens that data can be modified directly in the database, not via the application. I agree this is not best practice but in larger enterprises it happens.
Once you start implementing foreign keys in the client you are adding a lot of complexity to a problem that most mature relational database system do well enough to be trusted by a lot of traditional financial institutions.