タグ

2022年8月14日のブックマーク (1件)

  • Soft Deletion Probably Isn't Worth It

    Anyone who’s seen a couple different production database environments is likely familiar with the “soft deletion” pattern – instead of deleting data directly via DELETE statement, tables get an extra deleted_at timestamp and deletion is performed with an update statement instead: UPDATE foo SET deleted_at = now() WHERE id = $1; The concept behind soft deletion is to make deletion safer, and revers

    ohbarye
    ohbarye 2022/08/14
    brandurのsoft deletionに対する見解。既知のデメリットがあるが過去勤務したどの会社も使ってたし、hard deletionに明確なデメリットがあるのも既知。両者を克服する案は削除対象データを記録するテーブルを作って突っ込む