Sep 20, 2020, 3:40:18 PM |
You should always try to soft delete the records as it is good to keep the records that were added to the DB. There are few disadvantages of soft delete like:
- It will take more disk space if you keep the deleted record.
- In a data search, this can impact the performance.
- You have to create a composite unique index by including the deleted flag field.
But if the above points are manageable then you should always prefer soft delete as it has the following advantages:
- You can use the deleted data for any audit purpose.
- You can perform the data analytics if it is required.
- It helps us to intact the relationship between parent and child tables as the same id can be used for a single unique user.
Now based on the above explanation you can decide the suitable optionbased on the project you are working on. Still if you go with the hard delete option then you can keep the deleted records in an audit table. That can help you to retrieve the records in case of any audit. Please let me know if you have any further queries.0 | 0
Sep 20, 2020, 11:08:13 AM |
I think we should soft delete(mark as deleted) so that we can have data for any future use like analytics or any other purpose if the data is usefull or if data is of not any use than it should be deleted. So soft delete or hard delete depends upon the type of data i.e useful in future or not.0 | 0