Should my database have foreign key constraints?
There is an endless discussion in the development community about whether databases should include declared foreign key constraints or not.
As a consultant, I regularly visit a wide variety of client sites. Many of these have applications designed without constraints. When I ask why there are no constraints, the response is invariably one of the following:
- The app ensures that it’s right
- They don’t work well with our application development
- They are too slow
- What’s a foreign key constraint?
Most of the sites that I work with have sizeable databases. This discussion is important in those situations.
2016-05-31