gRPC is an open-source remote procedure call framework for connecting services. Define service methods and messages with protocol buffers, then generate server bindings and client stubs. A client calls a remote method through its stub, while the server implements the business logic. Generated bindings let services written in different languages share a contract without sharing language-specific models. section 1.0 section 1.1.2
Protocol buffers serialize messages into compact binary data, which gRPC exchanges over HTTP/2. The combination suits low-latency interservice calls and supports unary and streaming communication. It does not make a network call as simple as an in-process method call: services still need to handle failures and secure their connections. gRPC provides facilities for load balancing, tracing, health checking, and authentication. section 1.1.1 section 1.2 section 2.5 section 1.1
Choose the interface to fit its consumers:
- Use gRPC when low latency, streaming, or clients in multiple languages justify maintaining service definitions and generated bindings. section 1.2 section 1.3
- Consider REST for browser-facing APIs or a small application with only one or two services. Browser access to a gRPC service may require a proxy layer; internal services can still use gRPC. section 1.2 section 1.3
- Treat changes to protocol-buffer definitions as contract changes. Generated clients help reveal mismatches, but maintaining the definitions and their compatibility remains part of the work. section 1.3 section 3.0
Checkout calling other services
In an e-commerce system, a Checkout service can add generated Go stubs as dependencies to fetch cart items from Cart, obtain an address from Shipping, and request a charge from Payment. Each call crosses a service boundary, so the client must account for network failure rather than treating the stub as a local function. section 1.4.1
For a production implementation, keep the .proto definitions maintainable, generate bindings through CI/CD, and account for testing, security, and deployment alongside the service code. gRPC supplies the communication framework; it does not remove the operational work created by decomposing an application into services. section 3.0 section 1.4 section 1.1









