ulid / spec

The canonical spec for ulid
GNU General Public License v3.0
9.67k stars 174 forks source link

Differences and Similarities with uuidv6? #10

Open qcho opened 5 years ago

qcho commented 5 years ago

Didn't see this in the prior art section and i wonder if this spec tacles the same problems as the v6 not-official proposal did.

https://bradleypeabody.github.io/uuidv6/

Sorting by its raw bytes results in a sequence equivalent to sorting by its embedded timestamp, thus making it naturally more useful as a primary key and providing improved reference locality and thus insert performance. (I.e. primary keys that are out of sequence are not just useless for sorting, but can also cause unnecessary disk access due to occupying significantly different locations in the index. [example])
The embedded time should be extractable for use as the creation time of the record.
Global uniqueness, which is of course a basic requirement of all types of UUIDs.
ramsey commented 2 years ago

Take a look at the latest draft, which includes v6, v7, and v8: https://datatracker.ietf.org/doc/html/draft-peabody-dispatch-new-uuid-format-04

Version 7 UUIDs appear to be identical to ULIDs, with the exception of the UUID version and variant bits.