Google Professional Cloud Developer Question 1
Select 3Google Cloud PlatformYou are designing a high-performing API for a real-time stock trading platform. The API needs to handle a high volume of concurrent users with minimal latency. Which of the following design choices would best optimize the API’s performance?
- A
Use HTTP/2 for faster communication and multiplexed streams.
- B
Implement caching for frequently requested data using a distributed cache like Memorystore.
- C
Use synchronous API calls to ensure strict request-response workflows.
- D
Implement rate limiting and throttling to control API usage spikes.
- E
Store all user session data in a relational database for consistency.
Show answer and explanation
Correct answers: A, B, D
Explanation
To design a high-performing API, utilizing technologies like HTTP/2 and caching can drastically improve response times and reduce server load. Implementing rate limiting ensures the system remains stable during high traffic spikes. Avoiding synchronous workflows and database bottlenecks are also key to maintaining high performance in a real-time, high-concurrency environment.
- A. Correct.
HTTP/2 optimizes API communication by allowing multiplexed streams, header compression, and faster data transfer, which helps in reducing latency for high-volume traffic.
- B. Correct.
Caching frequently requested data in a distributed cache like Memorystore significantly reduces the load on backend systems and improves response times for users.
- C. Incorrect.
Synchronous API calls increase latency and block resources, making them less suitable for high-performance, high-concurrency scenarios.
- D. Correct.
Rate limiting and throttling help to manage traffic spikes effectively, avoid overloading the system, and ensure consistent performance for all users.
- E. Incorrect.
Storing session data in a relational database can lead to performance bottlenecks due to the high latency of database queries, making it unsuitable for a high-performing application.