Last post Oct 26, 2010 10:03 AM by AZMatt
Oct 26, 2010 09:33 AM|Ritesh Manglani|LINK
I am working on School MIS application and apparently, it has many Master profiles, like School, Student, Class, Division, Employee etc. In order to keep my database integrated and to maintain the consistency of data whenever someone deletes a master data
then everything related to that data also gets deleted.
However, as the application is progressing I am wondering if it is a right way to do it because when someone deletes a master data then there is hell lot of data which would also get deleted. And the related data which would get deleted would in turn have
other related data.
So if in my application if someone would delete a school then all the information related with a school like Students, Classes, Sections, Division, Employees should also get deleted and Students in turn would be associated with other data which should also
I was wondering what would be the best approach? What if someone deletes a master record it by mistake, though we would take the confirmation before deleting but if by any chance someone does it by mistake then it would cost the organizationa lot:)
1) Should we really provide a feature to delete a data or when user tried to delete a data then maybe we can deactivate it and all other related data by setting some flag in the table.
2) If we have to delete the data then, should we just take confirmation from the User once/twice and delete everything realted to it? It sounds absurd:)
3) Or we can display all the related data and then ask the customer something like "Hey, if you would delete this record then all the related information which you are seeing on the screen would get deleted along with it, ARE SURE YOU WANT TO CONTINUE?".
That way he would actually be able to see all the data which would get deleted.
I am sure there would be plenty of people out there who would have worked on big applications. Howz the Master data is being treated in such applications. What is the best practice for this?
Thanks in advance
Oct 26, 2010 10:03 AM|AZMatt|LINK
As a general rule, I would definately recommend either setting a flag or move the data off into some kind of archive or history tables to do a "logical delete" rather than a "hard delete". This approach can save you from huge problems when somebody says
they deleted something by accident. Even when you warn them not to, it will still happen!
Also, it is definately a good idea to confirm a delete with the users. It is up to you if you want to show them all related data or just give them a good explaination like "deleting a school will also delete students, classes, employees, etc." The approach
you take should be based on how confident you are that the users who have access to delete will understand the impact.
Of course, for large apps and DB's, you must make sure you have a good maintenance plan that will back up the database frequently. I recommend a full backup at least once a day (usually at night) and then incremental backups every 15 - 60 minutes depending
on the volume and importance of your data.