Flickr Accidentally Deletes a User's 4,000 Photos and Can't Get Them Back
91–93 of 93 posts
Re: Flickr Accidentally Deletes a User's 4,000 Photos and Can't Get Them Back
#92Earlier quoted context omitted.
> You never actually delete rows from your tables. You mark them as deleted, sure, but the data needs to be able to come back. Space is cheap, there are simply very few cases where outright deletion from a DB table is warranted. This comes with a cost, and it's not a small one. Every single query that ever touches this table, in every single piece of code owned by the company, written or maintained by every single de…
No, that's what views are for. A sane approach would be to do all your table access via views, and the view definitions have the 'where is_deleted = 0' or whatever. Then your database handles it. Updates to the view work as well, in pretty much every database system, including MySQL even.
Using views adds a layer of abstraction. That's often a good idea and a step in the right direction, but does come at the cost of increasing the overall complexity of the system. It's an incremental step to the positive, but no revolutionary solution.
Re: Flickr Accidentally Deletes a User's 4,000 Photos and Can't Get Them Back
#93This is why I never have a DELETE call anywhere in my app or admin code. I always mark as deleted (there are performance improvements in this for some databases as well)
I've worked at several places where the strategy is 'never delete, just mark as deleted'. Your database tends to grow pretty fast, but you never have to defragment your index or tablespace.