Google Cloud Professional Data Engineer — Question 117
You operate a database that stores stock trades and an application that retrieves average stock price for a given company over an adjustable window of time. The data is stored in Cloud Bigtable where the datetime of the stock trade is the beginning of the row key. Your application has thousands of concurrent users, and you notice that performance is starting to degrade as more stocks are added. What should you do to improve the performance of your application?
Answer options
- A. Change the row key syntax in your Cloud Bigtable table to begin with the stock symbol.
- B. Change the row key syntax in your Cloud Bigtable table to begin with a random number per second.
- C. Change the data pipeline to use BigQuery for storing stock trades, and update your application.
- D. Use Cloud Dataflow to write a summary of each day's stock trades to an Avro file on Cloud Storage. Update your application to read from Cloud Storage and Cloud Bigtable to compute the responses.
Correct answer: A
Explanation
Changing the row key syntax to start with the stock symbol (Option A) helps distribute the writes more evenly across the table, reducing hotspots and improving performance. Option B may still create hotspots due to time-based clustering. Option C suggests a change to BigQuery, which is not a direct solution for improving the existing Cloud Bigtable performance. Option D, while helpful for summarizing data, does not directly address the performance issue for concurrent users accessing stock trades.