3 ms·
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 distribute
by Cthulhu_ 3y ago
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.
- moffkalast 3y agoYou 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.
- EGreg 3y agoSo just prefix the node ID which is assigned when the node joins a swarm
- Timon3 3y agoHow is that easier or better? Now you're letting your infrastructure details bleed into your database.
- EGreg 3y agoThey 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
- Timon3 3y agoWhy? Tight coupling doesn't make things easier.