QuestionQ70

VerifiedStoring the data

You run a database that stores stock trades and an application that retrieves the average stock price for a specified company over an adjustable time window. The data is stored in Cloud Bigtable, with the stock-trade datetime at the start of the row key. Your application has thousands of concurrent users, and you observe performance beginning to degrade as additional stocks are added. What should you do to improve your application's performance?

Explanation

Cloud Bigtable stores row keys in lexicographic order, so using a timestamp as the row-key prefix concentrates sequential writes into a small key range and creates a hotspot. Starting the key with the stock symbol distributes traffic across symbols and keeps a single company’s timestamped trades contiguous, supporting efficient reads for a requested time range.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!