logoalt Hacker News

simonbuilds • yesterday at 8:09 PM • 2 replies • view on HN

So where do you actually draw the line for a business and a customers table whether to use uuidv4 vs uuidv7, in terms of privacy and efficiency?


Replies

vbezhenar • yesterday at 11:08 PM

I prefer to use int16/int32/int64 IDs for primary keys and UUIDv4 for "visible" keys. So database always uses integer fields to refer to other rows and web API uses UUID.

tyre • yesterday at 8:24 PM

Do you care about users knowing when another business was put into the system (e.g. how long they've been with you"? If yes, v4. If no, v7.

v4 is less efficient but more private.