Karly
Karly

Reputation: 389

Using activation fields in a database instead of deleting entities

I've been hearing that deleting datas from a database wasn't a good practice and that it is better to use boolean activated/non-activated fields when it comes to deleting entities in the database so the entity is logically erased but not physically...

What I'm wondering is: why do we have to keep the datas ?

Upvotes: 0

Views: 21

Answers (1)

kevinskio
kevinskio

Reputation: 4551

  • If management ever asks "when was this data deleted" it's handy to have a last_modified_date to lookup.
  • If the data relates to business logic and analysts want to know what period of time was this logic used in.
  • If the business is ever audited or subject to audit legislation disabled data shows what you did whereas the absence of data allows room for doubt as to what was done.
  • Table space/disk space is cheap allowing disabled data to be kept at less cost than trying to reconstruct it

Upvotes: 1

Related Questions