(no title)
GGO
|
1 year ago
I dont understand the recommendation of using bigserial with uuid column when you can use UUIDv7. I get that it made sense years ago when there was no UUIDv7, but why do people keep recommending it over UUIDv7 now beats me.
whynotmaybe|1 year ago
You can guess the time the system took between 2 uuid v7 id's.
They can only be used if they're not shown to the user. (so not in the form mysite.com/mypage? id=0190854d-7f9f-78fc-b9bc-598867ebf39a)
A big serial starting at a high number can't provide the time information.
TeeWEE|1 year ago
If you use only uuid in your outwards facing api then you still have the problem of slow queries. Since you need them to find the object (as mentioned below)
UUIDv7 has a random part, can be created distributedly, and indexes well.
It’s the best choice for modern application that support distributed data creation.
thiht|1 year ago
arp242|1 year ago
OskarS|1 year ago
1. The UUIDs should be ordered internally, for B-tree performance
2. The UUIDs should not be ordered externally, for security reasons
Why not use encryption? The unencrypted ID is a sequential id, but as soon as it leaves the database, it's always encrypted. Like, when getting it out:
and when putting stuff in: Seems like the best of both worlds, and you don't need to store separate things.sebazzz|1 year ago
Are you then not doing security by randomness if that is the thing that worries you?
dajtxx|1 year ago
inopinatus|1 year ago
Just goes to show you can’t inadvertently disclose anything these days.
mixmastamyk|1 year ago
hoffs|1 year ago