Google Cloud Professional Cloud Developer — Question 5
Your application takes an input from a user and publishes it to the user's contacts. This input is stored in a table in Cloud Spanner. Your application is more sensitive to latency and less sensitive to consistency.
How should you perform reads from Cloud Spanner for this application?
Answer options
- A. Perform Read-Only transactions.
- B. Perform stale reads using single-read methods.
- C. Perform strong reads using single-read methods.
- D. Perform stale reads using read-write transactions.
Correct answer: B
Explanation
The correct answer is B, as performing stale reads using single-read methods allows for reduced latency while still providing acceptable levels of data freshness. Options A and C focus on transaction types that prioritize consistency, which is not suitable for this application's requirements. Option D introduces unnecessary complexity by using read-write transactions when only reading is necessary.