|
|
|
|
|
by bearmcbearsly
2730 days ago
|
|
> No you cannot, unless you're running a single threaded server process on a single machine. What you can do is _gamble_ that you probably won't have a collision 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?