Google Professional Cloud Developer Question 2
Select 4Google Cloud PlatformYou are designing a REST API for a high-traffic e-commerce application that must handle thousands of requests per second. The API must minimize latency and ensure consistent performance under load. Which combination of design considerations should you prioritize to achieve these goals?
- A
Implementing caching for frequently accessed resources
- B
Using synchronous communication for all API calls
- C
Limiting payload size by using efficient data formats like JSON or Protocol Buffers
- D
Deploying the API across multiple regions with a global load balancer
- E
Using a single-threaded architecture to simplify request handling
- F
Enabling retries with exponential backoff for idempotent operations
Show answer and explanation
Correct answers: A, C, D, F
Explanation
To design a high-performing API, it is critical to implement caching, use efficient data formats, distribute traffic across regions using a global load balancer, and enable retries with exponential backoff for idempotent operations. These considerations help reduce latency, ensure scalability, and maintain reliability. Avoiding synchronous communication and single-threaded architectures further ensures the API can handle high traffic efficiently.
- A. Correct.
Implementing caching for frequently accessed resources reduces latency and improves performance by avoiding repeated processing of the same data.
- B. Incorrect.
Synchronous communication can lead to higher latency and blocking issues under heavy load, making it less suitable for high-performance APIs.
- C. Correct.
Efficient data formats like Protocol Buffers or compact JSON minimize payload size, reducing network latency and improving performance.
- D. Correct.
Deploying the API across multiple regions with a global load balancer ensures low latency and high availability by routing requests to the nearest or healthiest backend.
- E. Incorrect.
A single-threaded architecture may simplify development but can become a bottleneck under high load, reducing overall performance.
- F. Correct.
Retries with exponential backoff for idempotent operations improve reliability and avoid overloading the system during transient failures.