What gRPC Adds
gRPC is a framework for calling methods on a remote service as if they were local. It defines services in a schema and runs the calls over HTTP2, reusing its multiplexed streams.
Mapping A Call
Each remote call becomes one HTTP2 stream.
- The method name travels in the request path.
- Arguments and results are encoded as binary messages, usually with protocol buffers.
- Trailers at the end carry a status code that reports success or an error.
Because each call is its own stream, many calls run in parallel on one connection.
Four Call Shapes
gRPC supports more than a single request and response.
- Unary: one request, one response.
- Server streaming: one request, a stream of responses.
- Client streaming: a stream of requests, one response.
- Bidirectional: both sides stream at once over the same stream.
Streaming maps naturally onto the framing that HTTP2 already provides.
Why It Is Efficient
Binary messages are compact, headers are compressed, and one connection serves many calls. This makes gRPC popular for service to service traffic inside a cluster.
Key idea
gRPC maps each remote call onto an HTTP2 stream with binary messages and status trailers, supporting unary and streaming shapes for efficient service to service communication.