A company is designing a Cloud Spanner schema for a global user database. They anticipate high write throughput and want to avoid hotspotting on the primary key. Which primary key design strategy is MOST appropriate?
UUIDs distribute writes evenly across splits, avoiding hotspots.
Why this answer
Using a composite key with a hash prefix or a monotonically increasing value as the first part of the key can cause hotspots. UUIDs distribute writes evenly across splits. Using a UUID as the leading part of a composite key avoids hotspotting better than the other options.