Skip to content

Comment on Ask HN: ULID or CUID2 for B2B Startup?

Comments

ULIDs are time ordered and CUID2s are random. So your decision should really be based on whether you want ordered IDs are not. Ordering is useful for transactional entities because you tend to operate on recent entities much more than older ones and things like partitioning, indexing become easier, whereas for non-transactional long lived entities, it might not matter much. Some applications don't like to leak time information through their IDs so they choose random IDs.

There is also UUIDv7 now which is similar to ULID but UUID compatible and might be a more ubiquitous standard going forward.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.