Google Professional Cloud Developer Question 356
Single answerGoogle Cloud PlatformYou are developing an API for an e-commerce application on Google Cloud. The API needs to be exposed to external clients securely, with capabilities for rate limiting and authentication using OAuth 2.0. Which approach should you choose to meet these requirements while ensuring scalability and minimal operational overhead?
- A
Use Apigee as an API gateway to expose the API with rate limiting and OAuth 2.0 policies.
- B
Expose the API directly using a Google Kubernetes Engine (GKE) load balancer and implement rate limiting in your application code.
- C
Deploy the API on Cloud Functions and use Firebase Authentication to secure it.
- D
Host the API in Cloud Run and use Identity-Aware Proxy (IAP) to manage OAuth 2.0 authentication.
Show answer and explanation
Correct answer: A
Explanation
The best option for securely exposing and managing an API with features like rate limiting and OAuth 2.0 authentication is to use Apigee. Apigee provides a scalable, managed API gateway with built-in policies for security, traffic management, and analytics, ensuring a robust solution with minimal operational complexity.
- A. Correct.
This is the correct option because Apigee is a managed API gateway that provides built-in features for API management, including rate limiting, OAuth 2.0 authentication, and scalability, with minimal operational overhead.
- B. Incorrect.
This option is incorrect because implementing rate limiting in application code increases complexity and operational overhead. Additionally, a GKE load balancer does not natively support OAuth 2.0.
- C. Incorrect.
This option is incorrect because Firebase Authentication is more suitable for user authentication rather than API-level OAuth 2.0 authentication. It also lacks advanced API management features like rate limiting.
- D. Incorrect.
This option is incorrect because while IAP can handle OAuth 2.0 authentication, it is not designed for comprehensive API management features like rate limiting, which are essential for this scenario.