Are soft removes advisable or an awful idea?

Rather than really removing an archive inside your database, you'd just flag it as being "IsDeleted" = true, and upon recovery from the record you can just flag it as being "False".

Is advisable?

EDIT: this can be a much better idea??? how about physically removing the record then moving it to some exterior achieve database, when the user wants the record back, then software will search for the record within the exterior database and recreate it?

It's rarely an awful idea to prevent potential data loss.

I usually soft-remove. In instances where the database must be scrubbed of a number of records, I generally employ whether two-step procedure for soft deletion after which draining a "trash canInch of records, or perhaps a document-management-style approach where document records could be aged away, after which undergo an agreement process just before hard deletion.

It is dependent around the conditions. I saw situations where you stand legally needed to genuinely remove something. Maybe someone has asked for their ssn be permanently taken off the body. Or you possess a duplicate record you want to consolidate right into a single record. Keeping the duplicate hanging out having a erased flag is probably not beneficial.

There's also one technical disadvantage: You cannot do cascading down deletions, which instantly obvious out any references towards the erased data to avoid foreign key violations. This is not always a large problem, but it is something to bear in mind.

Otherwise, I believe it's wise.

I only say it's an awful idea, generally (with a few exceptions, possibly).

First, your database ought to be supported regularly, so you shouldn't be in times in which you would lose data permanently due to a Remove (unless of course it is a deletion of just-added data, obviously).

Second, a soft remove like which means you are in possession of to incorporate a WHERE IsDeleted = false clause in each and every query about this table (and thus much worse if you are JOINing these tables). An error here could be caught the moment a person or tester observed a erased record turning up again, that might take a while. Also, it might be simple for a developer to omit the WHERE clause from COUNT(*) queries, that might take a lot longer to uncover (I done one project where this have been happening for a long time very few records were ever "erased", therefore the totals were near to that which was expected with no one observed).

Finally, a soft remove works on the table with artificial secrets, but potentially will not focus on a table having a natural primary key (e.g. you "remove" someone from the table keyed by Ssn - where do you turn if you want to include him back? Do not say "include IsDeleted inside a compound primary key".).

Inside a design review, I'd expect the developer to show a comprehension from the costs and benefits and also to produce an excellent reason behind doing soft removes in this way. "Why not get it done?Inch isn't a great reason.

It's wise when and when an invalid remove is completely catastrophic and recovery ought to be simple. It is also advisable if you wish to keep an eye on exactly what has have you been and "remove" really only means "hide." Meaning, it's as much as the problem.

One of the leading problem for soft remove is individuals undesirable data will potentially affects the db performance. In the past among my Client asked for me to complete soft remove on all database products, my means to fix that's to maneuver all "erased" products to some backup table, rather than departing it to the present running tables.

If you are likely to use soft deletion, it's wise to possess a erased_date area, rather than an is_erased area. You receive a nice bit of extra data rather than only the bit area.

Soft removes would also permit you to revoke Remove rights in the database account utilized by the application.

It is dependent around the data. Some data can't be erased because of legal/audit needs.

Social networks however should offer an choice to remove a merchant account with all of connected data, including contact details, photos, messages, etc. It is a real annoyance when they don't, e.g. Facebook.