2 ms·
Spanner in particular wants random primary keys. But there are sharded DBMSes that still use sequential PKs, like Citus. There are also some use cases for semi-
by traderj0e 7mo ago
Spanner in particular wants random primary keys. But there are sharded DBMSes that still use sequential PKs, like Citus. There are also some use cases for semi-sequential PKs like uuid7.
- bddicken 7mo agoWhat about spanner specifically benefits from random ids over sequential ones?
- traderj0e 7mo agoI'm not an expert on Spanner, supposedly it's due to hotspotting. Your data is partitioned by primary key, and if you make that sequential, all new writes will hit the same master. https://docs.cloud.google.com/spanner/docs/schema-and-data-model#choose_a_primary_key https://docs.cloud.google.com/spanner/docs/schema-and-data-m... explicitly recommends a uuid4 or some other options That's another thing, some say to use uuid7 for sharded DBs, but this is a serious counterexample.