A contract first approach
gRPC is a remote procedure call framework where you call a method on a remote service as if it were local. The contract is written first in a protobuf schema that defines messages and service methods, and code is generated for both sides from it.
Why it is fast
- Protobuf serializes to a compact binary format, smaller and quicker to parse than text.
- It runs over HTTP 2, enabling multiplexed streams over one connection.
- It supports streaming: server, client, and bidirectional streams, not just one shot calls.
Trade offs to weigh
- The binary wire format is not human readable, so debugging needs tooling.
- Browser support is limited without a proxy layer.
- It shines for internal service to service traffic where performance and a strict typed contract matter most.
Generated stubs keep both ends in sync with the schema, so a field change surfaces as a compile error rather than a runtime surprise.
Key idea
gRPC uses a protobuf contract over HTTP 2 for fast typed streaming RPC, ideal for internal service to service calls.