QuickDevGuide

Home › GraphQL & gRPC

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