Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use UUIDv4 for audit records PKs #346

Open
kiler129 opened this issue Dec 30, 2022 · 2 comments
Open

Use UUIDv4 for audit records PKs #346

kiler129 opened this issue Dec 30, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@kiler129
Copy link

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 kiler129 added the enhancement New feature or request label Dec 30, 2022
@dmitryuk
Copy link
Contributor

dmitryuk commented Feb 27, 2023

@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.

@janklan
Copy link

janklan commented Apr 10, 2023

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants