Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7170099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:08:36+00:00 2026-05-28T15:08:36+00:00

I have an application that does complex calculations for members. Each member can have

  • 0

I have an application that does complex calculations for members. Each member can have multiple US states linked to their profile. Each state has got different calculations for each course a member completes.

As of now I have been performing the calculations in the DB (SQL Server 2008) and then sending data back to app layer where they can see their history and then download a certificate for each course.

I have a business logic layer but not a lot happens there. I know this has been asked a lot but where do you think I should perform these calculations: business layer or database? I am going back and forth!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T15:08:38+00:00Added an answer on May 28, 2026 at 3:08 pm

    I would basically do anything in SQL Server that:

    • does a lot of summing, counting, averaging etc. of data and returns only a single value.
      There’s really no point in transferring large volumes of data to the middle tier, just to sum up a column

    • does a lot of row / set-based manipulation; if you need to copy, insert, update lots of data, again, there’s really no point in dragging all that data to the middle tier and then sending it all back to the server – do it on the server right from the get go. Also: T-SQL is significantly faster in dealing with set-based operations (like shuffling data around) than anything in your middle tier could be

    In brief: try to avoid sending large volumes of data to the client/middle-tier/business layer unless you absolutely have to (e.g. because you want to download a file stored in a database, or if you really need to have those 200 rows materialized into objects in your app to be displayed somewhere or operated on)

    One feature that’s often overlooked are computed columns right in your database table – those are really good at e.g. summing up your order total plus tax and shipping into a grand total, or they are great to put together your first and last name into a display name. Those kinds of things really shouldn’t be handled only in the business logic layer – if you do those in the database directly, those “computed” values are also available to you when you inspect the database tables and look at the data in SQL Server Mgmt Studio …


    I would put it into the middle tier / business logic layer

    • if it required extensive logic checking, string parsing, pattern matching and so forth; T-SQL sucks at those things

    • if it required things like calling a web service to get some data to validate your data against, or something like that

    • if it required more of a business logic operation (rather than strict “atomic” database operations)

    But those are just “rough” guidelines – it’s always a design decision for each case, and I don’t believe in strict rules; your mileage may vary, from case to case – so pick the one approach that works best for any given task at hand.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have a complex application that does various things, e.g. brings up a
We have a swing based application that does complex processing on data. One of
We have an application that does single sign-on using a centralized authentication server (CAS).
I have a C# Application that does some maintenance tasks. It needs to run
i have an Java J2ME application that does (at user request) create HttpConnections to
I have a Windows Forms application that I wrote that does some monitoring of
I have a simple test application (C# console application) that does an HTTP GET
I have just been involved in writing an application that does not use Doctype's
We have a bug in our application that does not occur every time and
I have a Visual Studio 2008 C++ application that does something like this: template<

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.