Spring / Spring gRPC Interview Questions
What role does HTTP/2 play in gRPC?
HTTP/2 is the transport layer gRPC is built on, and several of its features are what make gRPC's performance and streaming model possible.
Multiplexing lets many independent request/response streams share a single TCP connection without one slow call blocking others (no head-of-line blocking at the application layer). HPACK header compression reduces the overhead of repeated metadata on every call. Binary framing makes parsing faster and more predictable than text-based HTTP/1.1.
Critically, HTTP/2's support for long-lived, full-duplex streams is what allows gRPC's server-streaming, client-streaming, and bidirectional-streaming call types to exist at all - each logical RPC maps onto an HTTP/2 stream that can carry multiple messages in either direction before it closes.
More Related questions...