Use databases without putting domain logic in them
My two main reasons for (almost) never putting logic in a database are<p>1) it will tie you to a specific database.  I know a handful of companies that have almost all of their IPR in the shape of stored procedures.  Even if they wanted to escape from the database vendor they can&#x27;t.  Not without rewriting everything they have spent a decade or two building.<p>2) languages such as PL&#x2F;SQL are much poorer than any modern programming language.  If you have ever tried to write a business application in PL&#x2F;SQL: it is no fun.  At least not for me.<p>(What I mean by &quot;almost never&quot; is that I do use constraints quite a lot which you could argue isn&#x27;t logic, but it is still asking the database to validate my data and model).