
Answer-first summary for fast verification
Answer: 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.
The primary issue is excessive requests overwhelming the Cloud SQL database. Option B addresses this by using Apigee's rate limiting and access control to reduce incoming traffic, and Pub/Sub to decouple request handling from database processing. Apigee policies manage traffic at the API layer, while Pub/Sub queues requests, enabling asynchronous processing and preventing database overload. This approach tackles both traffic control and backend scalability. Other options either lack traffic control (A, C) or rely on less scalable solutions like vertical scaling and custom rate-limiting (D).
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
Your ecommerce application's backend API is facing performance issues due to a rapidly growing user base, causing excessive requests that overwhelm the Cloud SQL database, resulting in latency and timeouts. As the team managing this API, how would you optimize its performance and improve user experience?
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.