
Answer-first summary for fast verification
Answer: A random universally unique identifier number (version 4 UUID)
For a transaction table in Cloud Spanner that stores product sales data, it is generally recommended to choose a primary key that allows for even distribution of data across nodes and minimizes hotspots. A random universally unique identifier number (version 4 UUID) is preferred because it uses random values in the bit sequence, minimizing the chances of creating hotspots and ensuring better performance.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
To effectively create a new transaction table in Cloud Spanner for storing product sales data, it is crucial to choose an appropriate primary key to optimize performance. Cloud Spanner, a horizontally scalable, strongly consistent, relational database service from Google Cloud, leverages primary keys for indexing and query efficiency. Considering performance impacts such as distribution of write and read operations, data locality, and hot-spotting, which strategy should you choose for the primary key?
A
The current epoch time
B
A concatenation of the product name and the current epoch time
C
A random universally unique identifier number (version 4 UUID)
D
The original order identification number from the sales system, which is a monotonically increasing integer
No comments yet.