You persist streaming stock prices in Bigtable and need to serve only the most recent prices. How should you design tables and row keys for the simplest access pattern?
Choose an answer
Tap an option to check your answer.
Correct answer: Create one table for all indices, using the index and timestamp as the row key..
Why this is the answer
The correct approach is to create one table for all indices, using the index and timestamp as the row key. Bigtable is designed for high-throughput, low-latency access to large datasets, and its performance scales with the number of rows, not tables. Consolidating data into a single table simplifies management and querying. By using indextimestamp as the row key, you can efficiently retrieve the most recent price for a given index by performing a row key scan starting from index and retrieving the last row. Bigtable stores data lexicographically by row key, so this pattern naturally groups all prices for a given index together, with newer prices appearing later in the scan. Using a reverse timestamp as the row key would allow for easy retrieval of the most recent data by scanning backward, but combining it with the index (e.g., indexreversetimestamp) still works well. However, for "simplest access pattern" when you need the most recent, indextimestamp allows a forward scan to the end of the index's range. Separate tables per index are inefficient as Bigtable performs best with fewer, larger tables.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed