Should I delete or disable a row in a relational database?

后端 未结 18 2262
忘了有多久
忘了有多久 2020-12-23 10:09

In a brand new program where space isn\'t really that big a deal, is it better to delete a row or to disable a row by let\'s say a boolean \"Disabled\" and have the program

18条回答
  •  生来不讨喜
    2020-12-23 10:35

    It depends. If it is disabled then it is easier to undelete / to see that someone actually deleted the record (for auditing).

    You may also have a technical requirement to not delete records. For example, if you wanted to synchronize your database with another user by just sending changed records you wouldn't be able to do that if it was actually deleted.

提交回复
热议问题