Re:Bye Sequence, Hello UUIDv7
by dheera on Sunday October 01, 2023 @11:03PM
(#37733480)
It's bad for performance if you frequently access large consecutive sets of records.
[ Parent
| on HN ]
UUIDs are good for data where I want either lots of different users being able to insert without collision, or lots of users who I want to keep their peepers off of other user's metadata (eg, how many X they add to the system per day).
In both cases I'm melding highly disjointed data into a single schema. There are no large consecutive sets of records.
If you're using UUIDs, there's probably a reason. And that reason invalidates the justifications for not using them.
> If you're using UUIDs, there's probably a reason.
Not really; think of how many architectural decisions are made purely based on imaginary scaling problems, or what the latest blog said.
I would wager that if you polled 100 backend devs, very few of them could correctly articulate the pros and cons of a randomized primary key.