top | item 45337570

(no title)

sixdimensional | 5 months ago

There is a good solution to concerns over this...

Use UUIDv7 for your primary key but only for large scale databases and only for internal keys. Don't expose these keys to anything outside the database or application.

Use UUIDv4 columns with unique indexes over them as "external IDs" which are what is exposed via APIs to other systems.

Basically, create two IDs for one record - one random but not the primary key, and one sequential, that is the primary key.

I have done this in real systems.. and it works.

discuss

order

No comments yet.