gRPC Streaming: the Four RPC Types — GraphQL & gRPC
gRPC runs over HTTP/2, so a single call can carry a stream of messages in either direction. Type proto Use case Unary rpc Get(Req) returns (Res) classic request/response Server streaming returns (stream Res) live feeds, large result sets, progress Client streaming rpc Upload(stream Chunk) returns (Summary) uploads, batching telemetry Bidirectional (stream Req) returns (stream Res) chat, real-time collaboration The example below runs a Node server and client in one file using @grpc/grpc-js and @grpc/proto-loader (dynamic loading — no code generation needed). In typed languages you generate stubs with protoc / buf generate instead.
Key Takeaways
HTTP/2 lets one gRPC call stream messages in either or both directions.
Server streaming suits feeds and large results; client streaming suits uploads.
Bidirectional streams are independent — reads and writes interleave freely.
Use dynamic loading for quick experiments and code generation for production.