Reputation: 15866
In StackOverflow,for example if user's point is greater than 20, they can downvote. What is the best way to detect these changes. I m using ASP.NET MVC. Should I control data changes and data comparison with C# or solve in database (store procedure, functions or etc)?
Thanks.
Upvotes: 0
Views: 175
Reputation: 12904
I don't really think there is going to be a one size fits all answer to this, it depends.
For your example, you are going to have to get the information from the DB at some point. Therefore you have the option of the DB doing the calculation or your business logic doing the calculation. This will almost certainly end up in a boolean field either way.
For other examples, it may be more complex and require considerable logic to determine a status and in this case, the DB is going to be the best bet.
So again, it is probably dependent.
Upvotes: 2
Reputation: 1039398
Those kind of requirements should be handled by your business layer, not the database.
Upvotes: 1