Google Cloud Professional Cloud Developer — Question 299
Your ecommerce application has a rapidly growing user base, and it is experiencing performance issues due to excessive requests to your backend API. Your team develops and manages this API. The Cloud SQL backend database is struggling to handle the high demand, leading to latency and timeouts. You need to implement a solution that optimizes API performance and improves user experience. What should you do?
Answer options
- A. Use Apigee to expose your API. Use Memorystore for Redis to cache frequently accessed data. Implement exponential backoff in the application to retry failed requests.
- B. Use Apigee to expose your API. Implement rate limiting and access control policies in Apigee to control API traffic. Use Pub/Sub to queue requests to prevent database overload.
- C. Use Cloud Load Balancing to expose your API. Use Cloud CDN in front of the load balancer to cache responses. Implement exponential backoff to retry failed requests.
- D. Use Cloud Load Balancing to expose your API. Increase the memory for the database instances to handle more concurrent requests. Implement a custom rate-limiting mechanism in your application code to control API requests.
Correct answer: A
Explanation
Option A is the best choice because using Apigee for API exposure along with Memorystore for Redis caching frequently accessed data will significantly reduce the load on the Cloud SQL database, enhancing performance. The other options either do not effectively address the database overload or rely on different mechanisms that may not optimize performance as well as caching does.