DataDogAuditBundle icon indicating copy to clipboard operation
DataDogAuditBundle copied to clipboard

Enhancement: Write only one blame entry for one flush call

Open SimonHeimberg opened this issue 7 years ago • 1 comments
trafficstars

Currently a blame entry is written to the audit_association table for every changed table. (Example: when one table and two associated ones are changed, the blaming user is written 3 times with the same info.) All of this blame entries contain the same data. (Because DataDogAudit is called at the very end, the user entity can not change while writing the log.) Writing the same data multiple times bloats the database unnecessary. This should not break backward compatibility (reading is the same as before).

ToDo:

  • Adapt the entity: ManyToOne instead of OneToOne for blame (does not change the database)
  • write blame only once in one flush() call, all written AuditLog entries point to this one.

SimonHeimberg avatar Jan 23 '18 07:01 SimonHeimberg

it may make sense if that will save you much of data, but in my opinion, it just makes it harder to deal with, if that is an issue, fork and adapt, or just use the logic in this library, to implement your custom case specific audit log, since still, you may need archiving and all. I do not plan to evolve this project

l3pp4rd avatar Feb 06 '18 21:02 l3pp4rd