Topic 1 Question 183
You are using Bigtable to persist and serve stock market data for each of the major indices. To serve the trading application, you need to access only the most recent stock prices that are streaming in. How should you design your row key and tables to ensure that you can access the data with the simplest query?
Create one unique table for all of the indices, and then use the index and timestamp as the row key design.
Create one unique table for all of the indices, and then use a reverse timestamp as the row key design.
For each index, have a separate table and use a timestamp as the row key design.
For each index, have a separate table and use a reverse timestamp as the row key design.
ユーザの投票
コメント(17)
This is special case , plese Take a look carefully the below link and read at last paragraph at the bottom of this comment, let everyone share idea, We will go with B, C https://cloud.google.com/bigtable/docs/schema-design#time-based
Don't use a timestamp by itself or at the beginning of a row key, because this will cause sequential writes to be pushed onto a single node, creating a hotspot.
If you usually retrieve the most recent records first, you can use a reversed timestamp in the row key by subtracting the timestamp from your programming language's maximum value for long integers (in Java, java.lang.Long.MAX_VALUE). With a reversed timestamp, the records will be ordered from most recent to least recent.
👍 9John_Pongthorn2022/09/26- 正解だと思う選択肢: B
B is the answer.
https://cloud.google.com/bigtable/docs/schema-design#time-based If you usually retrieve the most recent records first, you can use a reversed timestamp in the row key by subtracting the timestamp from your programming language's maximum value for long integers (in Java, java.lang.Long.MAX_VALUE). With a reversed timestamp, the records will be ordered from most recent to least recent.
👍 7zellck2022/11/29 - 正解だと思う選択肢: A
Indexes need to be unique, reverse timestamp is not necessarily unique
👍 4Teraflow2022/11/05
シャッフルモード