Remix.run Logo
▲ ricardobeat 2 hours ago

This is a misunderstanding of the purpose of UUIDv7. The whole point is to keep rows physically close, so you can very quickly extract an entire time range from a number of database shards, with minimal reads and compute. And be able to generate them without a centralized server. That's all there was to it, and something you'd only worry about when serving billions of records every hour.

They are also not supposed to be used as public IDs, just like you wouldn't use auto-incrementing IDs that way.

(I wrote a library for this 13y ago [1], around the time Twitter, Instagram et al started reaching enough scale to think about this kind of optimization)

[1] https://github.com/ricardobeat/unik