is deletion actually a thing or just formality in production?

Let's take shopify as an example, if a product is deleted, and as they claim deleted product can't be restored, how do they do their stats and other things related to orders Because the relationships in database will be Product -> Orders So technically if a product is deleted orders is supposed to be cascade deleted Or they have a boolean were on delete it sets thr product to deleted 😅 (or how do you handle such cases at work) Or will Orders be an Orhan were the relationship will be null on product deletion
9 Replies
Alex
Alex•12mo ago
In my company we have a boolean deleted for every table which we just set to true if we want to delete it. I think doing a hard delete has it’s reasons sometimes too
Lopen
LopenOP•12mo ago
But i am looking at the excess package involved in storing it (cost) Maybe that's why companies have terabytes/petabytes of data And also the performance cost Lets say
select user a
select user a
was supposed to go over 1 million columns but since nothing is actually deleted it may now go over 10 million
Alex
Alex•12mo ago
Indeed. If you don’t need the data for statistics or whatever it’s better to be hard deleted In case of shopify for example the payment and order data should probably be saved for legal reasons or something maybe
Lopen
LopenOP•12mo ago
who does not need statistics? 😉 exactly my thought but then why is no one coming clean about it
averagedev999
averagedev999•12mo ago
i hate soft deletes too but most clients prefer it over hard deletes so users can restore data just in case Implementing reliable soft deletes properly is a pain 😭
Lopen
LopenOP•12mo ago
whenever I hear "soft delete" Laravel comes to mind I have never seen anyone in Laravel do a hard delete
averagedev999
averagedev999•12mo ago
i never used laravel but i heard good things 🥹
Lopen
LopenOP•12mo ago
Lambo right?
averagedev999
averagedev999•12mo ago
lambo and a house 🥹 at least i get to walk and train my legs
Want results from more Discord servers?
Add your server