PROFESSIONAL-CLOUD-DEVELOPER · Question #207
You are writing from a Go application to a Cloud Spanner database. You want to optimize your application's performance using Google-recommended best practices. What should you do?
The correct answer is C. Write to Cloud Spanner using a custom gRPC client library. Note: The stated correct answer (C) conflicts with Google's official documentation. Google's recommended best practice for writing to Cloud Spanner from Go is to use the Cloud Client Libraries (option A). These libraries are the idiomatic, Google-maintained SDKs that handle…
Question
You are writing from a Go application to a Cloud Spanner database. You want to optimize your application's performance using Google-recommended best practices. What should you do?
Options
- AWrite to Cloud Spanner using Cloud Client Libraries.
- BWrite to Cloud Spanner using Google API Client Libraries
- CWrite to Cloud Spanner using a custom gRPC client library.
- DWrite to Cloud Spanner using a third-party HTTP client library.
How the community answered
(17 responses)- A18% (3)
- B6% (1)
- C71% (12)
- D6% (1)
Explanation
Note: The stated correct answer (C) conflicts with Google's official documentation. Google's recommended best practice for writing to Cloud Spanner from Go is to use the Cloud Client Libraries (option A). These libraries are the idiomatic, Google-maintained SDKs that handle authentication, session management, connection pooling, retry logic, and gRPC transport automatically - they are optimized specifically for each Google Cloud service. The Google API Client Libraries (B) are lower-level and not Spanner-optimized. A custom gRPC client (C) requires significant manual implementation of features the Cloud Client Libraries already provide. A third-party HTTP client (D) bypasses gRPC, which is less efficient. If your exam marks C as correct, it may reflect an outdated or erroneous question - always prefer Cloud Client Libraries in practice.
Topics
Community Discussion
No community discussion yet for this question.