8 versions of UUID and when to use them

Otter@lemmy.ca to Programming@programming.dev – 104 points –
ntietz.com
28

You are viewing a single comment

Reject UUID embrace ULID.

At the company I work at we use UUIDv7 but base63 encoded I believe. This gives you fairly short ids (16 chars iirc, it includes lowercase letters) that are also sortable.

base63? I'd guess you'd mean base64?

Anyways, doesn't that fuck with performance?

I'm using this in production: RT.Comb - That still generates GUIDs, but generates them sequential over time. Gives you both the benefits of sequential ids, and also the benefits of sequential keys. I haven't had any issues or collisions with that

I prefer CUID

Just to clarify: Yes, I do know not all use cases are appropriate for CUID. But in general when generating ID, I'd use CUID2