Of course referential integrity belongs at the database, the database has to be responsible for ensuring the data is as valid as posisble.
Scenario: I put my business logic in my database. I find I have performance issues. I tune, I solve some, I buy more hardware, I solve more issues. Now my customer base tripples (or quadruples) and my database is slow again. Now how do I scale?
A - Buy more hardware - cause we all know how cost effective those 32 proc Itanium 2s can be.
B - Spend untold amounts of money re-designing the database for partitioning.
or my preferred method
All "Business logic" goed into the app servers, the only API to the data is through the app servers. Anyone who touches data without going through the app servers doesn't work for me any more. When my app servers need to scale I buy *more* app servers. they're cheap, they are web servers, serving web services.
I've worked on too many databases over the years with all this "Business logic" built in and when you hit your performance ceiling the only option is to buy bigger because scaling out is nearly impossible. One company I worked for grew their customer base 20 fold over 4 years. IT has to move FAST to keep up with that level of growth.
I can only speak from experience. I was with my last company for four+ years. I worked on the enterprise architecture as the company grew from 1 million to 20 million subscribers and 2000 employees in a central location to 20,000 employees scattered across the country.
I have written many enterprise applications that seriously use (and sometimes abuse) the hardware they run on
In my experience
Always keep it simple, but not too simple
There was a thread on one of the SQL newsgroups where we were discussing Google's databases and the hardware they use to run them. Someone pointed us to a link by one of Google's chief engineers describing their proprietary database and indexing systems designed in-house (as it turns out most of their systems are not SQL-based), and the "throw-away" servers they use to run it all. Interesting stuff.
I'll see if I can locate the articles and post the links here later.