logoalt Hacker News

chuckadamsyesterday at 4:30 PM1 replyview on HN

I remember doing something similar, but I just used two columns, a public uuid, and a bigint primary key that wasn't exposed to the api (this was long before uuidv7). Lacked a lot of the conveniences of using uuid everywhere, but it still handled the use case of merging different DB dumps as long as PKs were stripped out first.

And maybe I misunderstand how the hashing works, but it seems if you're looking things up by the hashed uuid, you're still going to want two columns anyway.


Replies

connicpuyesterday at 10:13 PM

The conversion is reversible using the secret cryptographic key so you can turn the uuidv4s from requests into your db uuidv7s.