News for hackers. Stuff that matters.
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.