Live data from Hacker News

Understanding UUIDs, ULIDs and string representations

sudhir.io

101–104 of 104 posts

Re: Understanding UUIDs, ULIDs and string representations

#101
post #81

The whole section on serial number IDs is a bit FUDy in my opinion, especially this: > If you suddenly have a million people who want to buy things on your store, you can't ask them to wait because your sequence generator can't number their order line items fast enough. And because a sequence must store each number to disk before giving it out, your entire system is bottle-necked by the speed of rewriting a number on…

Think you’re right about the FUD part, will tone it down. Still think numbers are a horrible idea, but this shouldn’t be consideration for most people.

Re: Understanding UUIDs, ULIDs and string representations

#102
post #92

Earlier quoted context omitted.

It’s not clear why they don’t just use a finer-grained timestamp component (e.g. nanoseconds) and increase that number if two events are within the same clock interval, and keep the random component random.

The reference implementation is written in Javascript and I don't think that provides a reliable way to get timestamps this fine grained.

The underlying clock doesn’t need to be fine-grained; only the target representation needs to be fine-grained enough for the additional increments inserted by the code that generates the IDs. Effectively, the precision of the timestamp part needs to be large enough to support the number of IDs per second you want to be able to generate sustainably.

Re: Understanding UUIDs, ULIDs and string representations

#104
post #35
post #2

Author here, self-posted. AMA.

I think Base85 [0] warrants a mention for those needing to minimize the string representation length of their UUIDs. A year ago or so we had to store a reference to one of our entities into a legacy third-party system, which used char(20) as the column size and of course couldn't be changed. Since Base85 encodes a UUID as exactly 20 ASCII characters, it saved me from having to add an extra indirection. (Also, and to…

Thank you! I was familiar with Ascii85 but not Z85. I just added it to the "Other projects" section of my base converter. https://convert.zamicol.com/
Post reply on HN