3 ms·
Small consolation prize is we can generate unique primary keys: https://docs.pgdog.dev/features/sharding/primary-keys/ https://docs.pgdog.dev/features/sharding/
by levkk 1y ago
Small consolation prize is we can generate unique primary keys: https://docs.pgdog.dev/features/sharding/primary-keys/ https://docs.pgdog.dev/features/sharding/primary-keys/.
I would like to implement cross-shard unique indexes, but they are expensive to check for every query. Open to ideas!
- guiriduro 1y agoAren't UUIDs the a priori collision-free index of choice ?
- reactordev 1y agoThe problem is which version? Also does the cluster index need to be embedded? Or shard index? Or whatever you are using to track the storage of the record? Should we care?
- maherbeg 1y agoa nice way to solve this is a hash ring and put it in the ID. you can re-shard the ring as you need to, and can route to where the object lives easily.