Your company uses Cloud Spanner for a mission-critical inventory management system that is globally available. You recently loaded stock keeping unit (SKU) and product catalog data from a company acquisition and observed hot-spots in the Cloud Spanner database. You want to follow Google-recommended schema design practices to avoid performance degradation.
What should you do? (Choose two.)
- Use an auto-incrementing value as the primary key.
- Normalize the data model.
- Promote low-cardinality attributes in multi-attribute primary keys.
- Promote high-cardinality attributes in multi-attribute primary keys.
- Use bit-reverse sequential value as the primary key.
Answer(s): D,E
Explanation:
https://cloud.google.com/spanner/docs/schema-design D because high cardinality means you have more unique values in the collumn. That's a good thing for a hot-spotting issue. E because Spanner specifically has this feature to reduce hot spotting. Basically, it generates unique values https://cloud.google.com/spanner/docs/schema-design#bit_reverse_primary_key
D) Promote high-cardinality attributes in multi-attribute primary keys. This is a correct answer because promoting high-cardinality attributes in multi-attribute primary keys can help avoid hotspots in Cloud Spanner. High-cardinality attributes are those that have many distinct values, such as UUIDs, email addresses, or timestamps1. By placing high-cardinality attributes first in the primary key, you can ensure that the rows are distributed more evenly across the key space, and avoid having too many requests sent to the same server2. E) Use bit-reverse sequential value as the primary key. This is a correct answer because using bit-reverse sequential value as the primary key can help avoid hotspots in Cloud Spanner. Bit-reverse sequential value is a technique that reverses the bits of a monotonically increasing value, such as a timestamp or an auto-incrementing ID1. By reversing the bits, you can create a pseudo-random value that spreads the writes across the key space, and avoid having all the inserts occurring at the end of the table2.
Reveal Solution
Next Question