SQLServerCentral Article

Where should middle tier business logic be stored?

,

I had a discussion with my boss the other day.  It centered on where middle tier business logic should be stored.  Currently our products have most of their middle tier logic in Microsoft SQL Server stored procedures.  My boss would like to see more of that get pulled into a .NET dll. 

I have been programming for nearly 20 years.  I started working with Microsoft SQL Server back with version 6.5.  I have always felt that middle tier business logic should be in the database unless there is a really good reason to put it someplace else.  For me I like to know that when I insert or update or delete something I am calling the appropriate stored procedure and that procedure is handling the business logic.  I like having one place to look for that logic. 

Now, some of our logic is more than just simple insert, update and delete.  We have seen some speed improvement moving some of our more complicated middle tier logic to a .net dll.  So you can see how it would be natural for one to think, if moving middle tier logic to a .net dll worked for this it should work for all things.  Still, there can be a downside to using a .NET dll.

When the middle tier logic is in the database, it is easy to update.  When the middle tier is changed, then stored procedures change and update scripts are created and the database is updated.  We don’t have to re-release the website or stop and start windows services.  Now that some of the middle tier logic is in a .net dll, this dll needs to be installed in several places.  It gets used in the website, windows service, CLR, etc.  The performance gain is worth the trouble, but I would suggest that not all of the middle tier business logic would be worth this trouble.

So that leads to my question:  Where does your business store their middle tier business logic?

Rate

5 (1)

You rated this post out of 5. Change rating

Share

Share

Rate

5 (1)

You rated this post out of 5. Change rating