Earlier quoted context omitted.
> So why aren't we doing this? isn't IPv6 is basically that? just restricted to internet addresses
It's sort of this. Although it would've been nice if the size of the IP wasn't restricted, so one day we can add an optional segment on top and connect the whole Milky Way, or something.
Nanosecond timestamp collisions are common
71–80 of 291 posts
Re: Nanosecond timestamp collisions are common
#72Earlier quoted context omitted.
Isn’t it simpler to use sequence keys then?
Yes, but only on single machines, UUID and co are intended for distributed systems. Although now I wonder if / how UUID v7 can do sequential keys on distributed systems. Mind you, on those systems "close enough" will probably be good enough, and sorting will be done by date instead of incremental ID.
Probably too much overhead when conflicting UUIDs are a few orders of magnitude less likely than the clients crashing from some random bug though.
Re: Nanosecond timestamp collisions are common
#73Despite the resolution being nanoseconds, what is the actual precision of computer clocks? I can't imagine it is actually nanoseconds. Takes me back to teaching physics labs where I had to hound students to remember that the accuracy of their measuring device is not identical to the smallest number it displays...
ARMv8 guarantees that it's clock increments at at least 1Ghz, for intel and earlier ARM it's more complicated
Re: Nanosecond timestamp collisions are common
#74Earlier quoted context omitted.
If you're going to do that then you might as well just use UUID, since you effectively reintroduce the negative aspects of that (infinitesimally miniscule chance of collisions, computation involved in the calculation, etc.)
The difference is that you can still use sequential IDs internally, while exposing hashed IDs to the outside. This protects your database from collisions under all circumstances, while in the absolute worst case, a single user might experience bugs because two external IDs collide.
Re: Nanosecond timestamp collisions are common
#75Earlier quoted context omitted.
v7 looks nicer since it solves v4's locality issue and you're still a gazillion times more likely to win the lottery than generate a collision.
Unfortunately, many libraries don't implement it yet.
Re: Nanosecond timestamp collisions are common
#76This is why you should use ids that combine both a time component and a sequence. Eg UUIDv7 has a milliseconds time component and then a field that increments for each event in the same millisecond, and then enough random bits to make collisions between ids generated on different machines astronomically unlikely. Of course there are only so many bits so you might generate too many events in the same time slice so the…
Why do you need the time component anyway? It's just eating up bits in your UUID without contributing much entropy.
Re: Nanosecond timestamp collisions are common
#77Earlier quoted context omitted.
Why do you need the time component anyway? It's just eating up bits in your UUID without contributing much entropy.
You need it to make database indices perform better. If you don't need that, but just need a random UUID, UUIDv4 is better.
Re: Nanosecond timestamp collisions are common
#78Timestamps should probably never be used as a "unique" id.
The problem is achieving locality in cohesion/meaning, which usually involves locality in time, which provokes using timestamps as part of the id at the very least. But it's a chain of very lazy thinking IMHO and it's like a peek at the house of cards some large systems are built like.
Re: Nanosecond timestamp collisions are common
#79Re: Nanosecond timestamp collisions are common
#80This is why you should use ids that combine both a time component and a sequence. Eg UUIDv7 has a milliseconds time component and then a field that increments for each event in the same millisecond, and then enough random bits to make collisions between ids generated on different machines astronomically unlikely. Of course there are only so many bits so you might generate too many events in the same time slice so the…
Why do you need the time component anyway? It's just eating up bits in your UUID without contributing much entropy.