Google Professional Cloud Developer Question 47
Select 2Google Cloud PlatformYou are designing a microservices application on Google Cloud to handle high-throughput, low-latency communication between services. The application has a mix of real-time communication needs and occasional requests from external clients. Which communication method should you choose and why?
- A
Use gRPC for communication between internal microservices that require low latency and high performance.
- B
Use HTTP REST for communication between internal microservices due to its simplicity and wide adoption.
- C
Use gRPC for external client communication to take advantage of its bi-directional streaming capabilities.
- D
Use HTTP REST for external client communication to leverage its compatibility with standard web protocols and tools.
- E
Avoid using gRPC entirely as it is not suitable for production environments in Google Cloud.
Show answer and explanation
Correct answers: A, D
Explanation
For high-throughput, low-latency communication between internal microservices, gRPC is the best choice due to its performance and efficiency advantages over HTTP REST. However, for external client communication, HTTP REST is preferable because of its compatibility with standard web protocols and libraries, making it accessible to a broader range of clients. Selecting the appropriate communication method depends on the specific use case and audience (internal services versus external clients).
- A. Correct.
gRPC is well-suited for internal microservices communication as it is highly efficient, supports low-latency communication, and uses protocol buffers for serialization, which reduces payload size.
- B. Incorrect.
While HTTP REST is simpler and more widely adopted, it is less efficient for internal communication compared to gRPC, especially for high-throughput, low-latency scenarios.
- C. Incorrect.
Although gRPC supports bi-directional streaming, it is less compatible with external clients due to its reliance on HTTP/2 and protocol buffers, which are not natively supported by many external tools.
- D. Correct.
HTTP REST is ideal for external client communication because it is widely supported by web browsers, libraries, and tools, making it more accessible for external interactions.
- E. Incorrect.
This statement is incorrect as gRPC is production-ready and commonly used in Google Cloud and other environments that require high-performance inter-service communication.