gRPC Fundamentals
gRPC is a framework for calling a service method across a network through a typed contract. You define services and messages once, generate language-specific code, and use it to build clients and servers that can communicate across different languages.
itDistributed systems, messaging, and integration | OpenSkills.info
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Don't Panic
Don't Panic — gRPC Fundamentals
The corridor version: gRPC is a way to call a function that runs in another program on another machine and have it look almost like calling a function in your own. You write down what the functions are and what they accept, both sides generate code from that description, and most of the network plumbing is handled for you.
Before this, teams that wanted services to talk either invented a request format over HTTP and hand-wrote a client for every language, or reached for something heavier. The recurring cost was that the description of the API and the code that spoke it drifted apart. The fix here is to make one file the source of both.
That file is a .proto, written in Protocol Buffers: a schema language
that lists your messages and your service methods. A compiler turns it into
message classes, a client object called a stub, and a server interface, in
whichever supported language you asked for. The server implements the methods;
the client calls the stub; the contract between them is the file.
Three ideas carry most of the weight. There are four RPC shapes: one request and one response, a stream of responses to one request, a stream of requests to one response, and both sides streaming at once. Every call should carry a deadline, meaning how long the client will wait before it stops caring. And a call finishes with a status code, not just a value, so "it worked" and "it timed out" are different answers you have to handle separately.
Here is the part that catches people. The call looks local, but it is not, and the framework does not paper over the difference. A deadline firing means the client gave up; it does not mean the server did. If the method wrote to a database, it may have committed before you stopped waiting, so retrying it blindly can do the work twice. Cancelling a call stops further work; it does not roll anything back.
The other surprise is where the difficulty actually lives. Not in writing messages: in traffic. gRPC runs many calls over one long-lived connection, so an ordinary load balancer sends all of them to a single backend while the others sit idle. Fixing that needs a smarter proxy or a service mesh, and it shapes how the service gets deployed.
For the whole picture, read the Intro, with the Slides as the compressed version. The Cheatsheet has the RPC-shape table and the rules for turning a failure into the right status. The Practice tab builds a real unary service and forces a timeout on purpose. Field Notes covers what teams get wrong once the diagram makes sense: load balancing, deadlines that do not propagate, keepalive settings that close connections, and the few kilobytes you actually get for an error message.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://grpc.io/docs/what-is-grpc/introduction/
Supports
- gRPC service definitions, generated client and server code, and cross-language clients and servers
- Protocol Buffers as the usual interface definition language and message format
- `.proto` definitions, messages, `protoc`, and the gRPC compiler plugin
- https://grpc.io/docs/what-is-grpc/core-concepts/
Supports
- service definitions, stubs, and client and server responsibilities
- unary, server-streaming, client-streaming, and bidirectional streaming RPCs
- message ordering, call lifecycle, deadlines, cancellation, metadata, status details, and channels
- independent client and server conclusions and the lack of automatic rollback after cancellation
- https://grpc.io/docs/languages/
Supports
- supported-language documentation, quick starts, tutorials, and references
- https://grpc.io/docs/guides/
Supports
- task-oriented official guidance for authentication, deadlines, errors, health checking, retries, performance, and observability
- https://protobuf.dev/overview/
Supports
- Protocol Buffers message definitions, generated code, fields, serialization, and schema-language concepts
- https://github.com/grpc-ecosystem/awesome-grpc
Supports
- grpcurl as a command-line tool for interacting with gRPC servers
- Buf as a Protocol Buffers tool with linting and breaking-change detection
- ghz as a gRPC benchmarking and load-testing tool
- https://grpc.io/docs/languages/python/quickstart/
Supports
- Python gRPC runtime and generated-code quick-start workflow used by the practice reference and exercise
- https://protobuf.dev/programming-guides/encoding/
Supports
- Protocol Buffers wire encoding, field numbers, wire types, and compatibility reasoning used by the practice reference and exercise
- https://opensource.googleblog.com/2008/07/protocol-buffers-googles-data.html
Supports
- Protocol Buffers open-source announcement in July 2008
- https://developers.googleblog.com/2015/02/introducing-grpc-new-open-source-http2.html
Supports
- gRPC open-source announcement and its HTTP/2 RPC design
- https://www.rfc-editor.org/rfc/rfc7540
Supports
- HTTP/2 publication and the transport features gRPC uses
- https://protobuf.dev/support/version-support/
Supports
- Protocol Buffers 3.0.0 release information
- https://grpc.io/blog/ga-announcement/
Supports
- gRPC 1.0 general-availability announcement
- https://www.cncf.io/blog/2017/03/01/cloud-native-computing-foundation-host-grpc-google/
Supports
- gRPC donation to the CNCF in 2017
- https://grpc.io/blog/grpc-load-balancing/
Supports
- gRPC deployment load-balancing choices and HTTP/2 stream distribution
- https://grpc.io/blog/grpc-web-ga/
Supports
- gRPC-Web general availability and browser support constraints
- https://grpc.io/blog/grpc-js-1.0/
Supports
- gRPC-JS 1.0 release
- https://istio.io/latest/blog/2021/proxyless-grpc/
Supports
- Proxyless gRPC xDS integration with service-mesh control planes
- https://protobuf.dev/news/2023-06-29/
Supports
- Protocol Buffers Editions announcement
- https://grpc.io/blog/deadlines/
Supports
- Deadline selection, independent client and server outcomes, and resource-exhaustion risk
- https://grpc.io/docs/guides/keepalive/
Supports
- HTTP/2 PING keepalive coordination and GOAWAY behavior
- https://www.evanjones.ca/grpc-is-tricky.html
Supports
- Practitioner observations about gRPC keepalive and status-detail header-size failures
- https://buf.build/
Supports
- Buf as a Protocol Buffers linting, compatibility, and generation product
- https://thrift.apache.org/
Supports
- Apache Thrift as an alternative IDL and RPC framework
- https://connectrpc.com/
Supports
- Connect as a Protocol Buffers-based RPC option for browser and HTTP boundaries
- https://github.com/twitchtv/twirp
Supports
- Twirp as an HTTP/1.1 Protocol Buffers RPC alternative
- https://capnproto.org/
Supports
- Cap'n Proto as an alternative schema and RPC system
- https://www.envoyproxy.io/
Supports
- Envoy as an L7 proxy for gRPC traffic and gRPC-Web translation
- https://grpc-ecosystem.github.io/grpc-gateway/
Supports
- gRPC-Gateway as a generated JSON REST proxy for gRPC services
- https://github.com/grpc/grpc-web
Supports
- grpc-web browser client library and translation support
- https://istio.io/
Supports
- Istio traffic-management and service-mesh product context
- https://linkerd.io/
Supports
- Linkerd service-mesh product context for HTTP/2 and gRPC traffic
- https://github.com/fullstorydev/grpcurl
Supports
- grpcurl command-line gRPC client and reflection support
- https://ghz.sh/
Supports
- ghz gRPC load-testing and benchmarking product
- https://kreya.app/
Supports
- Kreya interactive gRPC client product
- https://www.postman.com/
Supports
- Postman gRPC client product context
