I have an internal discussion about where I should handle checking for data changes and cannot decide which practice makes the most sense:
- IsChanged processing in the GUI - this requires data constancy between page loading and publishing data, which can potentially lead to a large load on page throughput / delivery. This is not so bad in the application for forms of winnings, but on the website it can begin to have a significant financial impact on the cost of bandwidth.
- Processing it in DAL - this requires several calls to the database to check if any data has changed before they were saved. This potentially means an extra unnecessary call to the database, potentially causing scalability problems due to unnecessary database queries.
- Handling it in the Save () stored procedure - this will require that the stored process can make an extra unnecessary call in the table for verification, but would save an additional call from the DAL to the database. It can potentially scale better than having a DAL, but my gut says it can be done better.
- Handling it in a trigger - for this you will need to use a trigger (which I am emotionally off, I try to avoid triggers, except when it is absolutely necessary).
- Do not process IsChanged functionality at all - it’s not only difficult to process the “LastUpdated” date, but without having to enter data into the database as bad practice for scalability.
Thus, each approach has its drawbacks, and I am at a loss as to which is the best of this poor group. Does anyone have more scalable ideas for handling data storage with the specific goal of seeing if anything has changed?
Architecture: SQL Server 2005, ASP.NET MVC, IIS7, high scalability requirements for a non-specific global audience.
source
share