4 ms·
Isn’t it simpler to use sequence keys then?
by Mikhail_Edoshin 3y ago
Isn’t it simpler to use sequence keys then?
- Cthulhu_ 3y agoYes, 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.
- michaelt 3y agoAh but you see, UUIDs are web scale. And by web scale, I mean they're too big to exchange by any offline channel.
- Tade0 3y agoIt's 128 bits vs 64 bits - not really that much of a difference.
- SV_BubbleTime 3y agoFWIW… we’re using UUIDv7s over BLE.
- _flux 3y agoShould 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 :).
- SV_BubbleTime 3y agoIt’s for an auth use. And at least we’re using CBOR. But I get your point.