3 ms·
Personally I like no delete designs, which give you a full audit history of changes. This is similar to generally accepted accounting principles. https://en.wi
by GartzenDeHaes 4y ago
Personally I like no delete designs, which give you a full audit history of changes. This is similar to generally accepted accounting principles. https://en.wikipedia.org/wiki/Generally_Accepted_Accounting_Principles_(United_States) https://en.wikipedia.org/wiki/Generally_Accepted_Accounting_...
- munk-a 4y agoSo if an account was active in your system and is active no longer... do you soft delete it (even if that means UPDATE ... SET active = 'f') or hard delete it?
- GartzenDeHaes 4y agoThat depends on the problem domain and how you design the system, since there are several way to do this. Typically in financial systems you would either have a start and end date on a summary record, or add an inactive record to a transaction table that has a record for each change to the account, or both.
- znpy 4y agoYour taste in database design is probably nor gdpr compliant, i hope you don’t work in the eu.
- munk-a 4y agoIt's surprising but the EU tends to be one of the most stringent regions to work in both when it comes to totally permanently deleting things and when it comes to never ever deleting things - as with anything like this where there is a debate (rather than a settled best practice) there are some times when soft deletion is appropriate and necessary (i.e. to adhere to log retention requirements common in the EU) and some times when it's unnecessary... and the occasional fun time when it's both necessary to support soft deletes and hard deletes - when logs need to be retained for auditing purposes but also when some users can force a hard delete (leading to that data either being purged or moved to an archive storage if it's still needed for auditing purposes). The world is almost never as simple as it seems.
- sgjohnson 4y agoGDPR is probably the worst piece of law ever written. If an account is linked to invoices, it is perfectly reasonable to keep personally idenfitiable information for up to 10 years (would depend on each member state, but I don't think any have laws requiring you to keep invoices for more than 10 years). And because of that legal requirement you can justify keeping an audit trail of everything relevant for those transactions.