Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
sedatk
on Oct 13, 2024
|
parent
|
context
|
favorite
| on:
Analyzing New Unique Identifier Formats (UUIDv6, U...
Asynchronous unique ID generation.
HexDecOctBin
on Oct 13, 2024
[–]
You can have both asynchrony and sequence by encoding thread ID in the UUID too, and make the sequence a thread local state.
maxbond
on Oct 13, 2024
|
parent
|
next
[–]
MongoDB uses a similar approach.
https://www.mongodb.com/docs/manual/reference/method/ObjectI...
sedatk
on Oct 13, 2024
|
parent
|
prev
[–]
Then, just use thread ID and integer sequence pairs instead of trying to stuff them into an arbitrary binary format.
HexDecOctBin
on Oct 13, 2024
|
root
|
parent
[–]
Thread IDs get repeated across reboots. Integer sequence may also repeat in a distributed scenario, unless you want a massive bottleneck. You do need other stuff (timestamps, random number, etc.).
sedatk
on Oct 13, 2024
|
root
|
parent
[–]
Yes, but that’s what parent proposed? :shrug:
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: