Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.

Unlimited Access

Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.

Exam Professional Data Engineer topic 1 question 183 discussion

Actual exam question from Google's Professional Data Engineer
Question #: 183
Topic #: 1
[All Professional Data Engineer Questions]

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?

  • A. Create one unique table for all of the indices, and then use the index and timestamp as the row key design.
  • B. Create one unique table for all of the indices, and then use a reverse timestamp as the row key design.
  • C. For each index, have a separate table and use a timestamp as the row key design.
  • D. For each index, have a separate table and use a reverse timestamp as the row key design.
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
John_Pongthorn
Highly Voted 1 year, 7 months ago
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.
upvoted 16 times
Mcloudgirl
1 year, 5 months ago
I agree, based on the docs, B. Leading with a non-reversed timestamp will lead to hotspotting, reversed is the way to go.
upvoted 1 times
...
...
zellck
Highly Voted 1 year, 5 months ago
Selected Answer: 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.
upvoted 11 times
...
datapassionate
Most Recent 3 months, 2 weeks ago
Selected Answer: B
B is a correct answer because "you need to access only the most recent stock prices" "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." https://cloud.google.com/bigtable/docs/schema-design#time-based
upvoted 3 times
...
TVH_Data_Engineer
4 months, 1 week ago
Selected Answer: B
B. One unique table for all indices, reverse timestamp as row key: A single table for all indices keeps the structure simple. Using a reverse timestamp as part of the row key ensures that the most recent data comes first in the sorted order. This design is beneficial for quickly accessing the latest data. For example: you can convert the timestamp to a string and format it in reverse order, like "yyyyMMddHHmmss", ensuring newer dates and times are sorted lexicographically before older ones.
upvoted 2 times
...
kshehadyx
7 months, 2 weeks ago
Correct Is B
upvoted 1 times
...
arien_chen
8 months, 2 weeks ago
Selected Answer: D
Option B using reverse timestamp only, this is not the answer. the right answer should be using the index and revers timestamp as the row key. So, Option D is the only answer, because not A,B,C .
upvoted 5 times
...
Lanro
9 months ago
Selected Answer: B
https://cloud.google.com/bigtable/docs/schema-design#row-keys - If you usually retrieve the most recent records first, you can use a reversed timestamp B it is.
upvoted 1 times
...
Chom
9 months, 4 weeks ago
Selected Answer: A
A is the answer
upvoted 1 times
...
vaga1
10 months, 2 weeks ago
Selected Answer: B
the answer relieves on whether the application need to access the whole indexes at the same time or not. If yes then is B, if no is A. in mind the answer is yes, so B makes more sense: I retrieve all the list at the same time.
upvoted 1 times
...
ajdf
10 months, 3 weeks ago
Selected Answer: B
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.
upvoted 1 times
...
WillemHendr
10 months, 4 weeks ago
Selected Answer: B
"access the data with the simplest query"
upvoted 1 times
...
Prudvi3266
1 year ago
Selected Answer: A
yes reverse time stamp is recommended to prevent hot spot. But our query pattern is we need most recent record the is easy when you use Timestamp and Also option a stating that our row key not starting with time stamp which is index#timestamp and which is the most efficient way for this scenario.
upvoted 3 times
...
midgoo
1 year, 1 month ago
Selected Answer: B
Reversed timestamp will definitely help here.
upvoted 1 times
...
musumusu
1 year, 2 months ago
Answer A: I checked on other website and chatgpt also suggested A, to use index per stock and timestamp.
upvoted 1 times
...
niketd
1 year, 2 months ago
Selected Answer: B
The key here is "only the most recent stock prices". Doesn't talk about accessing a specific index - so answer should be B
upvoted 3 times
...
kostol
1 year, 2 months ago
Selected Answer: A
https://cloud.google.com/bigtable/docs/schema-design#row-keys-avoid
upvoted 1 times
...
desertlotus1211
1 year, 3 months ago
Answer is B: https://stackoverflow.com/questions/65487550/bigtable-reverse-timestamp-advantage-over-regular-timestamp You want to access the MOST recent stock price First. Reverse Timestamp
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...