3 ms·
ULID's initial segment is timestamp generated, with a random suffix at the end. This kind of collision you're concerned about is not an issue at all, across mul
by N_Lens 11mo ago
ULID's initial segment is timestamp generated, with a random suffix at the end. This kind of collision you're concerned about is not an issue at all, across multi-threads, processes or hosts.
- sedatk 11mo agoNot if the same ULID generator instance is used across threads.
- N_Lens 11mo agoThat depends on if the specific implementation of the generator instance is thread safe. Highly implausible to use the same generator instance between different threads/processes/hosts because there's no benefit at all and only additional downsides.
- sedatk 11mo agoTo implement a thread-safe sequential increment, you need locking. When you use locking, then it becomes a “non-universal” ID generator with arbitrary performance impact. Either it’s collision-prone or locking. Both are problematic in their own way. It’s footguns all over while UUIDv7 simply exists.
- N_Lens 11mo agoThere is practically no need to have a thread-safe ULID generator that would be shared across threads/processes/hosts - a non-scenario that I cannot envision occurring in practice.