Google Professional Cloud Developer Question 74
Select 3Google Cloud PlatformYou are developing a cloud-native application on Google Cloud. The application processes high volumes of user requests and occasionally experiences transient errors when calling external APIs. To ensure graceful error handling and scalability, which actions should you take?
- A
Implement exponential backoff with retries when calling external APIs.
- B
Use a global lock to serialize all requests to external APIs to avoid overloading them.
- C
Deploy a Circuit Breaker pattern to prevent cascading failures during API downtimes.
- D
Write all failed requests directly to a log file for manual reprocessing later.
- E
Leverage managed services like Cloud Tasks to queue and manage retry logic for failed requests.
Show answer and explanation
Correct answers: A, C, E
Explanation
To gracefully handle errors, disasters, and scaling events in cloud-native applications, it is essential to implement mechanisms like exponential backoff, Circuit Breaker patterns, and managed services for retry logic. These techniques enable the application to recover from transient errors and reduce the risk of system overload or cascading failures. Avoid practices that reduce scalability, such as global locks, and complement automated handling with monitoring for debugging purposes.
- A. Correct.
Correct. Exponential backoff ensures that the application retries transient errors in a controlled manner, which is a best practice for handling temporary failures.
- B. Incorrect.
Incorrect. Using a global lock would serialize all requests, significantly reducing the scalability of the application and increasing latency.
- C. Correct.
Correct. The Circuit Breaker pattern protects the system from making repeated calls to an unstable external API, improving system robustness.
- D. Incorrect.
Incorrect. While logging failures is useful for debugging, this approach does not provide an automated mechanism for retrying or handling transient errors.
- E. Correct.
Correct. Using managed services like Cloud Tasks can offload retry management and ensure scalability by decoupling request processing from immediate execution.