Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

24
  • 42
    I don't see things quite that simply. To me, it's ALL business logic. The database, with or without stored procedures, provides certain services and makes certain guarantees. Ideally it should be impossible for incorrect application code to put the database into an inconsistent state. If stored procedures are needed to maintain that consistency, I use them. Commented Apr 7, 2011 at 2:38
  • 16
    @kevin cline: Define "inconsistent state". I agree that DB features such as referential integrity are valuable and greatly reduce the prospect of an application error causing serious damage. However, generally speaking, the definition of "consistent data" depends on correct execution of business rules. Commented Apr 7, 2011 at 3:46
  • 20
    add my million to Mayo's million. Distributed business logic takes you off of the highway of good practice, straight into the lane of lunacy Commented Apr 7, 2011 at 9:23
  • 28
    +1 Business logic seeping into the DAL is a great concern when using stored procedures. Commented Apr 7, 2011 at 15:59
  • 34
    @ChristopherMahan, I would NEVER want to use a database you design. That is the worst possible practice from a database perspective. Databases are often affected directly at the database. It is short-sighted to think someone will use the business layer to update a million records or other things that happen over time. Imports do not typeically go through the business layer (yep I want to process my 21 million record import one record at a time in the business layer). Fraud is much easier when you don't have constraints at the database level. Bad data is almost 100% certain. Commented Jan 6, 2012 at 21:05