
Answer-first summary for fast verification
Answer: Create one unique table for all of the indices, and then use a reverse timestamp as the row key design.
The correct answer is **B**. Using a reverse timestamp as the row key design in a single table for all indices allows for efficient access to the most recent data. This design ensures that the latest data, having the highest timestamp value, is stored at the beginning of the row key range, making queries for recent data straightforward and quick. - **Option A** is incorrect because using a timestamp without reversing it would not prioritize the most recent data, requiring additional filtering. - **Option C** is incorrect because combining index and timestamp in the row key complicates accessing the latest data across all indices. - **Option D** is incorrect because managing separate tables for each index is less efficient than a single table solution.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
You are using Bigtable to store and deliver stock market data for major indices. Your trading application needs to access the most recent streaming stock prices efficiently. How should you design your row key and tables to facilitate easy access with a straightforward query?
A
For each index, have a separate table and use a timestamp as the row key design.
B
Create one unique table for all of the indices, and then use a reverse timestamp as the row key design.
C
Create one unique table for all of the indices, and then use the index and timestamp as the row key design.
D
For each index, have a separate table and use a reverse timestamp as the row key design.