7 ms·
I was going to post about "use a UUID", but I was surprised to learn that no UUID uses both timestamp + a random component. You can either get fully random with
by getmeinrn 3y ago
I was going to post about "use a UUID", but I was surprised to learn that no UUID uses both timestamp + a random component. You can either get fully random with UUID4, or have a time + MAC based UUID with UUID1. Strange, I would have thought there would exist a UUID that uses time + random to minimize collisions like described in the post.
- OJFord 3y agoULID (and I think UUIDv7 draft) has millisecond timestamp + 80b randomness.
- LAC-Tech 3y agoI believe the proposed UUIDv7 standard uses this. https://datatracker.ietf.org/doc/html/draft-peabody-dispatch-new-uuid-format#name-uuid-version-7 https://datatracker.ietf.org/doc/html/draft-peabody-dispatch... It's a draft but there's a lot of implementations out there.
- wood_spirit 3y agothe new UUIDv6, 7 and 8 work the way you deacribe.
- dtech 3y agoOnly v6 and v7, v8 is "whatever you want".
- mcv 3y agoThat's not much of a standard.
- throwawaymobule 3y agoFrom my reading, it's standardized because it has a version number embedded, so it won't get confused with other uuids. Probably a good idea to have somewhere to silo bespoke implementations. Just gotta hope they end up being unique.
- dtech 3y agoIt's not uncommon to provide a way how to do it in standards because it will happen whether you want it or not. See e.g. HTTP headers starting with X- or MIME types in application/vnd.
- nabogh 3y agoCan't find much info about it but is this UUID v7?
- deleted 3y ago[deleted]
- zote 3y agosomeone else in the thread mentioned UUIDv7
- sethammons 3y agoKsuid may be what you want. Pretty much time sortable uuid. Go implementation: https://github.com/segmentio/ksuid https://github.com/segmentio/ksuid