
Answer-first summary for fast verification
Answer: Promote high-cardinality attributes in multi-attribute primary keys., Use bit-reverse sequential value as the primary key.
To avoid hotspots in Cloud Spanner, it's recommended to distribute the load evenly across the database. Using an auto-incrementing value as the primary key (Option A) can lead to hotspots because all new inserts will go to the same split. Normalizing the data model (Option B) is a general best practice but doesn't directly address hotspotting. Promoting low-cardinality attributes in multi-attribute primary keys (Option C) can exacerbate hotspotting because it reduces the distribution of keys. Promoting high-cardinality attributes in multi-attribute primary keys (Option D) helps distribute the load more evenly, thus avoiding hotspots. Using a bit-reverse sequential value as the primary key (Option E) is a Google-recommended practice to avoid hotspots because it distributes the keys more evenly across the splits.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
How can you adhere to Google's recommended schema design practices to prevent performance degradation in a globally available Cloud Spanner database for a mission-critical inventory management system, after experiencing hotspots due to loading SKU and product catalog data from an acquisition? (Select two options.)
A
Use an auto-incrementing value as the primary key.
B
Normalize the data model.
C
Promote low-cardinality attributes in multi-attribute primary keys.
D
Promote high-cardinality attributes in multi-attribute primary keys.
E
Use bit-reverse sequential value as the primary key.
No comments yet.