Post #2194226
2026-05-06 13:36 UTC
Hot take: the VAST majority of the time you should be deleting database records and avoiding creating a `deleted_at` flag and carrying deleted things in your database.
Once you have active/inactive records, all your queries get more complicated, and you need to think a LOT more about how the lifecycle of these records works in connection with its relations and other biz logic.
It gets hairy quickly.
Replies (2)
-
@hejsna@ruby.social 2026-05-07 04:52
@soulcutter@ruby.social there have been a handful of times (2? 3?) where one of our admin users messed something up and I had to spin up a new point-in-time db instance to get it back. Over four years of operation! Soft delete is one of those insidious ”what if” taxes that drag a codebase down. Hard to argue against because you come off as the reckless cowboy in the discussion.
-
@relistan@mstdn.social 2026-05-07 09:14
@soulcutter@ruby.social soft deletes (with eventual clean-up) are a good solution to eventual consistency issues, particularly in async, evented systems, which usually scale better than synchronous systems. There is no "tax" if your system is designed that way.