Brandur Leach, Soft Deletion Probably Isn’t Worth It.

Brandur Leach, “Soft Deletion Probably Isn’t Worth It,” accessed March 6, 2023, https://brandur.org/soft-deletion.

Reading notes.

Soft delete allows easy restoration. It leaks filtering requirements into query logic, though, and even where this is made easy to do, it’s then easy to forget in manual contexts. It also breaks the benefits of foreign keys. Things like GDPR frown on retaining data unnecessarily. SAoft deletion never actually ends up supporting undeletion, either. Deletions often have side effects in other systems, and un-soft-deleting won’t magically cause the right thing to occur there.

A deleted records JSONB table is probably more useful where there’s a use case of needing to reference old data for troubleshooting etc. Supports regulatory compliance much more easily.