DamienHarper/auditor-bundle

Use UUIDv4 for audit records PKs

kiler129 opened this issue · 2 comments

On larger systems the auto increment causes a table lock, which decreases performance. With UUIDv4 primary keys the whole UoW can be built and then flushed without any back-and-forth to the database.

I'm guessing one of the challenges can be sorting. However, a precise microsecond time stamp could solve it easily.

WDYT about such an addition?

@kiler129 Can you provide any article about this behavior in database? Anyway you should create primary key - unique index will be checked for every entry before inserting.

My two cents of thoughts are:

  1. If you use UUID6, you can use the ID to sort the data in time-related order
  2. On a large system, wouldn't it make sense to log the events asynchronously anyway?