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
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
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 was supposed to go over 1 million columns but since nothing is actually deleted it may now go over 10 million
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
who does not need statistics? 😉
exactly my thought but then why is no one coming clean about it
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 ðŸ˜
whenever I hear "soft delete" Laravel comes to mind
I have never seen anyone in Laravel do a hard delete
i never used laravel but i heard good things 🥹
Lambo right?
lambo and a house 🥹
at least i get to walk and train my legs