← Lessons

quiz vs the machine

Platinum1750

Networking

gRPC Streaming

Four call shapes from a single request to a full bidirectional stream.

5 min read · advanced · beat Platinum to climb

Beyond one request one response

gRPC runs on HTTP2, whose multiplexed streams let a single call carry a sequence of messages rather than just one. This unlocks four call shapes.

The four shapes

  • Unary is the familiar one request and one response.
  • Server streaming sends one request and receives many responses, useful for feeds.
  • Client streaming sends many requests and gets one response, useful for uploads.
  • Bidirectional streaming lets both sides send sequences independently over the same call.

How it works underneath

Each call is an HTTP2 stream, and messages are length prefixed frames within it. Because HTTP2 multiplexes many streams over one connection, several streaming calls coexist without blocking each other at the application layer. Flow control keeps a fast sender from overwhelming a slow receiver, and either side can signal the end of its message stream. Bidirectional streaming is powerful but requires careful handling of ordering and backpressure.

Key idea

gRPC uses HTTP2 streams to offer unary, server, client, and bidirectional streaming over a single multiplexed connection.

Check yourself

Answer to earn rating on the learn ladder.

1. Which gRPC shape sends many requests and one response?

2. What underlies a gRPC streaming call?

3. What prevents a fast sender overwhelming a slow receiver?