Are foreign keys really necessary in a database design?

Niyaz picture Niyaz · Aug 20, 2008 · Viewed 37.1k times · Source

As far as I know, foreign keys (FK) are used to aid the programmer to manipulate data in the correct way. Suppose a programmer is actually doing this in the right manner already, then do we really need the concept of foreign keys?

Are there any other uses for foreign keys? Am I missing something here?

Answer

John Topley picture John Topley · Aug 20, 2008

Foreign keys help enforce referential integrity at the data level. They also improve performance because they're normally indexed by default.