Would you choose UUID v6/v7 if they were more stable and prevalent do you think? Or does the base32 encoding of ULIDs play a siginifics role in preferring them?
Well, canonical hex encoding isn’t enforced in any way. You can use whatever encoding format you want.
One of the downsides—potentially—is that each ULID leaks the information of when it was created. I mean, this is obviously one of the big selling points of ULIDs, but there might be situations where it’s undesirable.
I came here to say this… The main reason to use random UUIDs is that they are meaningless identifiers and they do not reveal anything else (increment counts, creation dates, node where entity was created, whether one entity was created before/after the other one, entity types, categories, tags or other metadata).
There might be a reason to use ULID sometimes, but when designing a system and identifier scheme, I would be rather a bit paranoid by default and do not encode any other data into identifier unless I have a really good reason to do so.
Nit: only UUIDv4 is random. Versions 1 and 2 definitely leak information, since they encode a timestamp and a MAC address of the node generating the id.
Braintree doesn’t use globally-unique ids for their transaction records. 48 hours I’ll never get back.
Hi, I work at Braintree and we do and have always used globally unique ids for transactions. You may have run into a recent issue we had, though (https://status.braintreepayments.com/incidents/n1hf4hj89lks). We have since cleaned up the duplicate ids and put measures into place to help prevent issues like this in the future. If that timeline doesn’t line up with what you saw, we’d love to know more.
No, this was caused by switching a dev environment to a different sandbox account. Your API was giving us transaction IDs that were colliding with ids we received from the previous merchant. Thankfully, this never impacted production.
I sincerely doubt that your ids are globally unique because they’re far too short for that, and because of this blog post.
That post is referring to the fact that a transaction id might be the same as a customer id, and that given only an id, we don’t know what type it is. Transaction ids are unique against all other transaction ids.
Nevertheless, your sandbox did repeat transaction ids. I have two days’ wasted time to show for it.
Creator of https://www.ulidtools.com here - nice site! ULIDS ftw.
Are you sure that these strings are UUIDv4?
For anyone who’s wondering what makes them not UUIDv4s, I guess it’s because the the first part,
01859DB9-
, does not look very random. A UUIDv4 however is completely random, like:This issue is that the version/variant aren’t correct for UUIDv4. You can see when you decode them: https://www.uuidtools.com/decode
Thanks! Didn’t knew that the version is encoded in the UUID.
Wow, that’s great! Is it open source?