4 Matching Annotations
- Mar 2024
-
meta.stackexchange.com meta.stackexchange.com
-
There is no active user with that ID, so you cannot search by it. The whole point of deleting an account is to make it inaccessible, unreferenced, and unlinked. We're not going to implement "soft" account deletion.
-
-
softwareengineering.stackexchange.com softwareengineering.stackexchange.com
-
I am currently working with a system presently where every table has a Deleted flag for soft-delete. It is the bane of all existence. It totally breaks relational integrity when a user can "delete" a record from one table, yet children records which FK back to that table are not cascade soft-deleted. Really makes for trash data after time passes.
-
Now you have something with all of the benefits of soft-deletes but none of the drawbacks:
-
So, soft delete is better, right? No, not really: Setting up cascades becomes extremely difficult. You almost always end up with what appear to the client as orphaned rows. You only get to track one deletion. What if the row is deleted and undeleted multiple times? Read performance suffers, although this can be mitigated somewhat with partitioning, views, and/or filtered indexes. As hinted at earlier, it may actually be illegal in some scenarios/jurisdictions.
-