logoalt Hacker News

bddickenlast Monday at 10:20 PM1 replyview on HN

What about spanner specifically benefits from random ids over sequential ones?


Replies

traderj0eyesterday at 5:21 PM

I'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-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.