Effective strategy for leaving an audit trail/change history for DB applications?

后端 未结 6 1642
有刺的猬
有刺的猬 2020-12-13 14:22

What are some strategies that people have had success with for maintaining a change history for data in a fairly complex database. One of the applications that I frequently

6条回答
  •  北海茫月
    2020-12-13 15:25

    Similar to a trigger (or even with) you can have every transaction fire a logging event asynchronously and have another process (or just thread) actually handle the logging. There would be many ways to implement this depending upon your application. I suggest having the application fire the event so that it does not cause unnecessary load on your first transaction (which sometimes leads to locks from cascading audit logs).

    In addition, you may be able to improve performance to the primary database by keeping the audit database in a separate location.

提交回复
热议问题