gRPC is a remote procedure call approach for distributed systems and microservices. It defines service contracts with protocol buffers, generates messaging scaffolding, and lets clients invoke operations across networks instead of exchanging loosely defined REST payloads. section 11.5
Use gRPC when a formally defined, high-throughput service contract matters:
- Serialize, parse, and transmit messages faster than JSON, with protocol buffers providing formal serialization across languages. section 11.5
- Generate boilerplate for message handling and service scaffolding instead of building variable-input JSON processing with raw messages, interfaces, and reflection. section 11.5
- Accept trade-offs: binary output is not readily human-readable, browser testing is harder, contracts are more complicated to build, and incompatible changes can break clients. section 11.5
A chat service
Define CommentRequest, CommentResponse, and ChatService in proto3; generate code with protoc; run a Python server on localhost:50051; then have a Go client dial it, send a timestamped “Hello World!” comment, and print the returned message length and previous-comment count. Streaming can be declared with an RPC returning a stream of CommentResponse values.









