Why do we need Audit Columns in Database Tables?

后端 未结 4 1727
刺人心
刺人心 2020-12-31 10:57

I have seen many database designs having following audit columns on all the tables...

  • Created By
  • Create DateTime
  • Updated By
  • Upldated
4条回答
  •  温柔的废话
    2020-12-31 11:34

    Many applications are developed using some OOP language in which there is generally a class like BusinessObject that contains what is perceived generally helpful information like such auditing fields. Not all subclassing entities may need it, but it's there if they do. Since the overhead of the db is small and the chances that the client may request another odd statistic based on the audit fields it's better to have them around than not to have them at all. If something represents a static list of information such as country names I generally wouldn't put it in the db at all - enumerated data type are created just for such purposes.

提交回复
热议问题