Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate in favor of UUIDv7 #91

Open
booch opened this issue Oct 2, 2023 · 8 comments
Open

Deprecate in favor of UUIDv7 #91

booch opened this issue Oct 2, 2023 · 8 comments

Comments

@booch
Copy link

booch commented Oct 2, 2023

I just read about UUIDv7. It's a proposed IETF standard, in "last call". Other than the base32 encoding, it's got everything we want from ULID. UUIDv7 will be more widely accepted and available to developers.

I propose that we declare victory, and allow the UUID spec to take over the effort from here on.

@booch
Copy link
Author

booch commented Oct 2, 2023

See #85 for some additional discussion.

@peterbourgon
Copy link

ULIDv7 has weaker rules for each part of the ID, and sacrifices 4 bits of entropy to a static version identifier. It's different enough that I don't think it makes sense to "deprecate" ULIDs.

@arokettu
Copy link

arokettu commented May 2, 2024

4 bits

6 bits. Still, UUIDv7 solves some ULID issues like predictability of the monotonic factory, and UUIDs being better supported in databases in general

@peterbourgon
Copy link

ULIDs don't have predictable monotonicity unless generated as such, and database support is a red herring 🤷

@arokettu
Copy link

arokettu commented May 2, 2024

ULIDs don't have predictable monotonicity unless generated as such

ULID spec is unclear about that (#80) but some implementations are monotonic by default in spec-described unsafe way (like symfony/uid)

database support is a red herring 🤷

It's not, it's the reason I'm no longer using ULIDs for new projects

@peterbourgon
Copy link

peterbourgon commented May 2, 2024

ULIDs and UUIDs are represented in databases identically: as 128bit numbers both.

Whether or not IDs have monotonic entropy is opt-in by the producer. And whether or not predictable monotonicity is a problem is a function of use case (it is not always a problem).

@arokettu
Copy link

arokettu commented May 2, 2024

ULIDs and UUIDs are represented in databases identically: as 128bit numbers both.

If stored in binary, you can't manually query a ULID given its string. With UUID even without db support you can simply remove dashes and query as a raw hex

@fabiolimace
Copy link

You all probably already know, but just in case, RFC 9562 was published a few days ago (May 7, 2024). RFC 4122 is obsolete and UUIDv7 is now official.

https://www.rfc-editor.org/rfc/rfc9562
https://datatracker.ietf.org/doc/rfc9562

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants