top | item 39323127

(no title)

inquist | 2 years ago

What’s wrong with uuidv4 as PK?

discuss

order

marcosdumay|2 years ago

Serial integers always work better than any uuid as PKs, but the thing with uuid4 is that it disrupts any kind of index or physical ordering you decide to put on your data.

Uuids are really for external communication, not in-system organization.

dalyons|2 years ago

FWIW this isn’t true anymore with newer uuid schemes like v7 that are roughly time sortable.

ildjarn|2 years ago

Serial index forces a synchronisation point on every entity that can create records. If this is only ever a single database that’s fine but plenty of apps can’t scale this way.