Best implementation for fully auditable data model?

前端 未结 6 2076
情深已故
情深已故 2021-02-06 14:36

My requirement is for a data model where a full audit trail is retained for changes to every attribute of every object. Object definitions are also fluid: new attributes can ap

6条回答
  •  佛祖请我去吃肉
    2021-02-06 15:20

    The question of how to store the data depends on how it is going to be used amongst other issues. I'd suggest going with something simple which you understand for now, testing if you have an idea of the likely load you expect. Then in future making improvements as necessary.

    In relation to your issue with a trigger based auditing system, since it sounds like you're set on having the work done at the database level I've one suggestion. Use triggers to log changes to a table within the database, then overnight (or however frequently) process the contents of the table and create the audit trail wherever it is being stored and empty the contents of the table in the database. This way you can capture changes at the database level but still fulfil your requirement to store the actual audit trail elsewhere.

提交回复
热议问题