Remix.run Logo
crazygringo a day ago

For distributed databases where you can't use autoincrement.

Or where, for some reason, the ID needs to be created before being inserted into the database. Like you're inserting into multiple services at once.

sgarland a day ago | parent [-]

Many distributed databases have mechanisms to use an auto-increment, actually - often, generating large chunks at a time to hand out.

grapesodaaaaa 15 hours ago | parent [-]

Our “distributed database” at a fortune 90 company spans at least 10 different database products.

UUIDv4 lets us sidestep this.

Is it bad design? Probably. Is it going to happen at huge companies? Yes.

sgarland 9 hours ago | parent [-]

You’re not wrong, of course. It’s a natural consequence of the eschewing of DBAs, and the increasingly powerful compute available - even if someone did notice that the slowdown was due to the PK choice, they can often “fix” that by paying more money.