Example scenario: an Uber-style rider app
Consider the backend of a ride-hailing app. When a rider taps “Request a ride,” the trip service fans out multiple calls: it queries the driver service for nearby cars, the pricing service for a fare estimate, the location service for live tracking, and the notification service to alert drivers. One user action can generate many internal service calls per request.

- HTTP/1.1 often requires separate TCP connections (or a very limited number of simultaneous connections) to achieve parallelism. Clients and browsers typically limit concurrent connections.
- New connections imply fresh TCP and TLS handshakes, adding tens to hundreds of milliseconds of latency depending on network conditions.
- Head-of-line blocking on a connection can delay subsequent requests if one is slow.
- Each request sends repeated plain-text headers (authorization tokens, trace IDs, etc.), which can be hundreds of bytes per request and waste bandwidth at scale.

- Multiplexing: a single TCP/TLS connection carries many concurrent streams (lightweight channels), so you avoid many parallel handshakes.
- Header compression (HPACK): repeated headers are compressed using a shared state table, so subsequent requests send far fewer header bytes.
- Better utilization of an existing secure connection reduces CPU and latency overhead for many short-lived calls.

-
Compact binary serialization — Protocol Buffers (protobuf)
- Protobuf is a binary, strongly typed serialization format. Binary encodings are smaller on the wire and faster for machines to parse than verbose JSON.
- Example JSON:
- Equivalent protobuf bytes (hex view):
- Smaller payloads and cheaper parsing reduce latency and CPU usage at scale.
-
Strongly typed service contract in a
.protofile- A single
.protofile defines your service, RPC methods, and message types. From that file, code generators produce client and server stubs in many languages, ensuring both sides share the same contract. - Example service definition:
- Generated client code makes a remote call look like a local function:
- gRPC handles serialization, HTTP/2 transport, and deserialization under the hood.
- A single
Where gRPC is a good fit
Use gRPC for internal service-to-service communication where you need high throughput, low latency, compact binary payloads, and a strong typed contract across languages. For public-facing APIs (browsers, third-party integrations), REST/HTTP+JSON remains widely supported and easier for clients without gRPC tooling.
- gRPC runs on top of HTTP/2 and gains multiplexing and header-compression benefits from that transport.
- gRPC adds protobuf binary encoding (smaller/faster) and a
.protoservice contract that generates client/server code. - For high-volume internal microservices, gRPC often outperforms HTTP/JSON solutions in latency, bandwidth, and developer productivity. For public, human-facing APIs, REST/JSON is still common due to broad client support.
- gRPC official site
- Protocol Buffers (protobuf)
- HTTP/2 overview (MDN)
- HTTP/1.1 (MDN)
- HTTP/3 and QUIC (MDN)