paralleldrive/cuid

Question: how this compares with ulid ?

gunzip opened this issue · 1 comments

  1. ulid lacks the client fingerprint. It may get away with that because by default, it will only use a CSRNG rather than pseudo-random source.
  2. cuid has been battle tested in production in apps with hundreds of millions of users since 2012. We have never had a verified report of collision issues. We continuously run collision tests across multiple generating hosts. I have never seen them fail in a production release of cuid (Beware: I have seen slug collisions).
  3. As of this writing, cuid is used in 488 packages and over 21,000 repos, including the native id generator for some dbms systems. ulid is used in 34 packages and 153 repos. This doesn't mean it's better, but it does provide evidence that it's a lot more battle tested.
  4. Because cuid doesn't rely on CSRNG, it is likely to be faster, and synchronous.
  5. ulid is more configurable -- it allows you to supply your own time and random number generators via the factory -- this could also be considered a downside, because you trade off consistency and the assurance that your id generating methods are battle-tested and collision resistant.