Google Professional Cloud Developer Question 436
Select 2Google Cloud PlatformYou are building a serverless application on Google Cloud that needs to interact with the Cloud Storage API to upload and retrieve files. Your application requires high performance and type safety. Which option(s) would be the most appropriate to make these API calls?
- A
Use the Cloud Client Library for Cloud Storage
- B
Use the REST API by sending HTTP requests manually
- C
Use gRPC for Cloud Storage
- D
Use the API Explorer in the Google Cloud Console
Show answer and explanation
Correct answers: A, C
Explanation
The Cloud Client Library and gRPC are the most appropriate options for interacting with Cloud Storage in a serverless application. The Cloud Client Library is user-friendly, efficient, and provides type safety, while gRPC offers high performance and type safety for APIs that support it. Using the REST API manually or the API Explorer is less suitable for production-grade applications due to their complexity or limited capabilities.
- A. Correct.
The Cloud Client Library is a recommended option for interacting with Google Cloud services. It provides a high-level abstraction, type safety, and is optimized for performance. This makes it suitable for production-grade applications.
- B. Incorrect.
Using the REST API manually requires you to handle authentication, request formatting, and parsing responses, which can be error-prone and less efficient. While it works, it is not the most developer-friendly or performant approach.
- C. Correct.
gRPC is a high-performance RPC framework supported by some Google Cloud APIs, such as Cloud Storage. It is efficient and provides type safety, making it suitable for high-performance applications.
- D. Incorrect.
The API Explorer is a tool for testing and exploring APIs directly in the Google Cloud Console. It is not designed for production applications and lacks the performance and integration capabilities needed in a serverless application.