0
0
Microservicessystem_design~5 mins

gRPC for internal communication in Microservices - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is gRPC and why is it used for internal communication in microservices?
gRPC is a fast, open-source remote procedure call (RPC) framework that uses HTTP/2 for transport. It is used for internal communication because it supports efficient, low-latency, and strongly-typed communication between microservices.
Click to reveal answer
intermediate
How does gRPC use Protocol Buffers in communication?
gRPC uses Protocol Buffers (protobuf) as its interface definition language and message format. Protobuf defines the service methods and message structures, which are then compiled into code for different languages, enabling efficient serialization and deserialization.
Click to reveal answer
intermediate
What are the benefits of using HTTP/2 in gRPC?
HTTP/2 allows multiplexing multiple requests over a single connection, reduces latency with header compression, and supports bidirectional streaming. This makes gRPC communication faster and more efficient compared to HTTP/1.1.
Click to reveal answer
intermediate
Explain the difference between unary and streaming RPC in gRPC.
Unary RPC is a simple request-response where the client sends one request and gets one response. Streaming RPC allows sending multiple messages: client streaming sends many requests, server streaming sends many responses, and bidirectional streaming allows both sides to send multiple messages.
Click to reveal answer
advanced
Why is gRPC considered suitable for internal microservice communication but less common for public APIs?
gRPC is efficient and strongly typed, ideal for internal services where performance and strict contracts matter. However, it requires HTTP/2 and protobuf clients, which may limit browser support and ease of use for public APIs compared to REST/JSON.
Click to reveal answer
What transport protocol does gRPC use by default?
AUDP
BHTTP/1.1
CTCP
DHTTP/2
Which serialization format is primarily used by gRPC?
AJSON
BXML
CProtocol Buffers
DYAML
Which gRPC communication type allows both client and server to send multiple messages independently?
ABidirectional streaming RPC
BUnary RPC
CServer streaming RPC
DClient streaming RPC
Why is gRPC preferred for internal microservice communication?
AIt supports low latency and strong typing
BIt is easier to use in browsers
CIt uses plain text messages
DIt uses XML for data exchange
Which of the following is NOT a feature of gRPC?
AAutomatic code generation from service definitions
BUses HTTP/1.1 for transport
CSupports streaming communication
DSupport for multiple languages
Describe how gRPC works for internal communication between microservices.
Think about the transport, message format, and communication patterns.
You got /5 concepts.
    Explain the advantages and limitations of using gRPC for internal microservice communication.
    Consider both technical benefits and practical constraints.
    You got /3 concepts.