by bearmcbearsly · 7y ago · 0 comments
This seems like a pointless distinction.
If I did the math right, you can generate 1,000,000 ULIDs per second (1000 per millisecond) for around 50 million years before you can expect to hit your first collision.
I don't know about you, but I'm pretty sure any system I build won't be running 50 million years from now. Not to mention that the timestamp portion of the ULID will overflow in a mere 9000 years.
Here is the Python code I used: https://gist.github.com/ngrilly/565bd27f4ad63244f72578844bca...
But I'm curious to know how you computed this?
On the other hand, your consistency assumptions may be broken if you rely on the sort order for causality relationship.
You can have ULID1 < ULID2 and yet the event associated with ULID1 may be caused by the ULID2 event.