Closed codinronan closed 4 years ago
Yes. Have you read the spec?
Yes. It talks about within a single machine, or rather, doesn't explicitly say that among different machines, ULIDs generated in the same millisecond will be globally unique (the phrase 'globally unique' doesn't appear). Thus the question.
I realize it might be a bit pedantic, I just wanted to verify..
A ULID has 80 bits of randomness so, for most intents and purposes, you should be fine. You should ask yourself why you're choosing, or considering, a ULID over a (G/U)UID (for example or maybe an auto-incrementing ID) in the first place. Once you can answer that question for yourself you should also be able to answer if the 80 random bits are "(globally) unique" enough for you. The chance of a collision for both a (G/U)UID) and ULID) differ by several orders of magnitude but are still very, very small in both cases.
Hey @RobThree thanks so much for answering. Ok, that should be sufficient. The reason I'm considering it are:
I apologize if this isn't the place to ask this --
Specifically my scenario would be to use the Javascript ULID library inside AWS lambdas, which are processing the incoming messages and assigning them IDs which are then partitioned in Dynamo (for which ULID is an ideal structure).
This is a scenario where several lambdas may be receiving messages in the same moment. Will these generate unique globally unique ULIDs?