Just a disclaimer: I've never done a "real" web app. My opinion in the following subject is extremely fragile and can be easily refuted.
A long long time ago, my father, while I was studying for the Database Systems course, asked me (ironically) if I could explain him what's the use for Foreign Keys on today's databases.
And the truth, after all these years, I still haven't been able to give him an explanation.
Fourth generation programming languages (I'm talking about SQL) were designed to be usable by non-programmer in a simple way. It was supposed for "clients" of a database to interact directly with the data through a very high level language.
Fortunately this has never happened, and the communication with databases is always wrapped by some kind of code (sometimes with an ORM framework).
Foreign keys are constraints which serve to guarantee data integrity. They are useful in the hypothetical situation where clients could tamper with the data directly. And, as nothing comes free, ensuring this constraints costs important CPU cycles.
Today's applications don't rely on these mechanisms to guarantee database integrity. It is the wrapper around the DB that ensures it.
So the question is: in applications where it is important to optimize database queries why use foreign keys?? And this leads to another question, why don't companies supply DBMS that don't have the foreign keys functionalities??
Can anyone answer this?
ps: In my applications I don't explicitly set foreign keys. Even if the performance is not a requirement. It just seems stupid to use something that shouldn't be there.
ps2: To make my opinion even clearer: I don't believe foreign keys in today's Relational DBMS have any relevance. They are just a performance penalty.