
Answer-first summary for fast verification
Answer: Rowkey: date#device_id Column data: data_point
The correct answer is A. This is because the most common query is for all the data for a given device for a given day. In Bigtable, it's crucial to design the row key in a way that aligns with the most common query patterns. By using Rowkey: date#device_id, the data is organized in such a way that the lookup for a specific device on a specific day becomes efficient. Although using date first can potentially lead to hotspotting issues, it's the best option among the provided ones for optimizing the read access pattern specified in the question.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
MJTelco is looking to implement a schema in Google Bigtable to facilitate the historical analysis of records spanning the past 2 years. These records are generated every 15 minutes, each containing a unique device identifier and associated data. The primary query requirement involves retrieving all data entries for a specific device on a particular day. What schema design would best meet these requirements?
A
Rowkey: date#device_id Column data: data_point
B
Rowkey: date Column data: device_id, data_point
C
Rowkey: device_id Column data: date, data_point
D
Rowkey: data_point Column data: device_id, date
E
Rowkey: date#data_point Column data: device_id
No comments yet.