News for hackers. Stuff that matters.
Re:Nanosecond timestamp collisions are common by Mikhail_Edoshin on Friday July 21, 2023 @04:04AM (#36811262)
Isn’t it simpler to use sequence keys then?
Re:Nanosecond timestamp collisions are common by Cthulhu_ on Friday July 21, 2023 @04:08AM (#36811293)
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.

Re:Nanosecond timestamp collisions are common by moffkalast on Friday July 21, 2023 @05:42AM (#36811885)
You could also keep a global incremental index for that, assuming there's some authoritative server that has to be polled sequentially to get them.

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 by EGreg on Friday July 21, 2023 @07:14AM (#36812444)
So just prefix the node ID which is assigned when the node joins a swarm
Re:Nanosecond timestamp collisions are common by Timon3 on Friday July 21, 2023 @09:12AM (#36813350)
How is that easier or better? Now you're letting your infrastructure details bleed into your database.
Re:Nanosecond timestamp collisions are common by EGreg on Friday July 21, 2023 @10:12AM (#36813991)
They should bleed into your database. The database is part of your infrastructure and it contains details like where to find the replicas and so on
Re:Nanosecond timestamp collisions are common by Timon3 on Friday July 21, 2023 @10:50AM (#36814486)
Why? Tight coupling doesn't make things easier.
Re:Nanosecond timestamp collisions are common by EGreg on Friday July 21, 2023 @11:59AM (#36815407)
You’re complaining that the infrastructure details are bleeding into the intrastructure implementation?
Re:Nanosecond timestamp collisions are common by Timon3 on Friday July 21, 2023 @12:02PM (#36815448)
Infrastructure details are bleeding into non-infrastructure implementation. Your database content is not an infrastructure implementation.
Re:Nanosecond timestamp collisions are common by EGreg on Friday July 21, 2023 @05:49PM (#36820352)
the content is not, but it can use a database function, such as CURRENT_TIMESTAMP or RANDOM() can it not?
Re:Nanosecond timestamp collisions are common by Timon3 on Saturday July 22, 2023 @02:46AM (#36823918)
I'm not sure what you're getting at. How are those connected to the topic? Those functions aren't infrastructure implementations either.
Re:Nanosecond timestamp collisions are common by michaelt on Friday July 21, 2023 @04:18AM (#36811369)
Ah but you see, UUIDs are web scale.

And by web scale, I mean they're too big to exchange by any offline channel.

Re:Nanosecond timestamp collisions are common by Tade0 on Friday July 21, 2023 @04:29AM (#36811428)
It's 128 bits vs 64 bits - not really that much of a difference.
Re:Nanosecond timestamp collisions are common by SV_BubbleTime on Friday July 21, 2023 @12:21PM (#36815727)
FWIW… we’re using UUIDv7s over BLE.
Re:Nanosecond timestamp collisions are common by _flux on Friday July 21, 2023 @03:24PM (#36818333)
Should you, though? BLE itself uses UUIDs, but the ones it uses are in a shortened format just because the BLE frames are small and the protocol is not too fast.

Granted I've even used JSON over GATT so maybe I should keep my mouth shut :).

Re:Nanosecond timestamp collisions are common by SV_BubbleTime on Friday July 21, 2023 @03:30PM (#36818411)
It’s for an auth use. And at least we’re using CBOR. But I get your point.