4 ms·
> They have a temporal aspect to them (IE, I know row with ID 225 was created before row with ID 392, and approximately when they might be created) UUIDv7 (cur
by spiffytech 5y ago
> They have a temporal aspect to them (IE, I know row with ID 225 was created before row with ID 392, and approximately when they might be created)
UUIDv7 (currently a draft spec[0]) are IDs that can be sorted in the chronological order they were created
In the meantime, ulid[1] and ksuid[2] are popular time-sortable ID schemes, both previously discussed on HN[3]
[0] https://datatracker.ietf.org/doc/html/draft-peabody-dispatch-new-uuid-format#section-4.4 https://datatracker.ietf.org/doc/html/draft-peabody-dispatch...
[1] https://github.com/ulid/spec https://github.com/ulid/spec
[2] https://github.com/segmentio/ksuid https://github.com/segmentio/ksuid
[3] ulid discussion: https://news.ycombinator.com/item?id=18768909 https://news.ycombinator.com/item?id=18768909
UUIDv7 discusison: https://news.ycombinator.com/item?id=28088213 https://news.ycombinator.com/item?id=28088213
- gavinray 5y agoWow, neat. TIL
- stjohnswarts 5y agoHmmm that's really useful :) . thanks!
- codetrotter 5y agoYup this. Ulid is great, and implemented in many languages. For example there’s a crate named Ulid that you can use that gives you ulid’s in Rust.
- djbusby 5y agoCame here to also hype ULID. It's just like INT, but 128bit, timestamps, every lang, and moving data around is trivial because no ID ever collide with anything else ever. Makes finding crap in my logs easier. (But UUID has that feature too) - it's the sorting that does it for me.
- ChristianGeek 5y agoIs there a PostgreSQL extension for ulid?
- CMCDragonkai 5y agoI had reviewed existing UUIDv7 implementations and many were incorrect or had subtle timing bugs. We ended up implementing UUIDv7 in our ID generation library https://github.com/MatrixAI/js-id https://github.com/MatrixAI/js-id. And we have a number of tests ensuring that it is truly monotonic even across process restarts. See IdSortable.