.NET Architecture & System Design Interview Question #116
When is gRPC useful in .NET systems?
Microservices, API Gateway, Service Communication & Event-Driven Architecture Mid-Level Intermediate
Quick Interview Answer
gRPC is useful for strongly typed, high-performance remote procedure calls, especially for internal service-to-service communication. It uses Protocol Buffers and supports features such as streaming.
Detailed Explanation
gRPC is useful for strongly typed, high-performance remote procedure calls, especially for internal service-to-service communication. It uses Protocol Buffers and supports features such as streaming.
It can reduce payload size and provide generated contracts, but browser compatibility, debugging experience, infrastructure support, and public API requirements should be considered before choosing it.
Code Example
service Inventory {
rpc GetStock (StockRequest)
returns (StockReply);
}
// .NET generates strongly typed clients.