nerdexam
Google

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…

Integrating Google Cloud Services

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)
  • A
    18% (3)
  • B
    6% (1)
  • C
    71% (12)
  • D
    6% (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

#Cloud Spanner#Go#gRPC#Performance Optimization

Community Discussion

No community discussion yet for this question.

Full PROFESSIONAL-CLOUD-DEVELOPER Practice