What is gRPC — HTTP vs gRPC for your next API
HTTP is universal, human-readable and understood by every tool in the stack. gRPC is faster on the wire, strongly typed at the boundary, and awkward everywhere a browser is involved. This conversation works through which properties actually decide the choice for a new API.
- 2024-04-04
- GeekyAnts
- APIs · gRPC · Distributed systems
What the comparison is actually about
HTTP with JSON is the default for good reasons. It is platform-independent, inspectable with tools everyone already has, tolerant of schema drift, and supported by every client that has ever existed. Those properties are worth more than they look, and they are the reason most APIs should stay exactly where they are.
gRPC trades several of them away. It uses HTTP/2 as a transport and Protocol Buffers as a wire format, which makes serialisation compact and fast and gives both sides a schema they must agree on. What you lose is readability on the wire, casual debugging, and — without a proxy layer — direct browser support.
Where the trade pays
Service-to-service traffic inside your own infrastructure is where gRPC is at its strongest. The calls are frequent, the payloads are repetitive, both ends are yours, and the schema is an asset rather than an obstacle. Streaming is first-class rather than bolted on, which matters for anything that pushes rather than polls.
The typing is often underrated as a benefit. A generated client that will not compile against a changed message is a whole class of integration bug caught before deployment rather than during it.
Where it does not
Public APIs consumed by third parties, anything a browser calls directly, and low-traffic endpoints where serialisation was never the bottleneck. In those cases the operational cost — proxies, tooling, the fact that nobody can debug it with curl — outweighs a performance win you will not measure.
The honest summary is that this is a decision about coupling and traffic shape, not about which protocol is better.
- HTTP wins on ubiquity, inspectability and tolerance of change.
- gRPC wins on serialisation cost, first-class streaming and an enforced schema.
- Internal service-to-service traffic is where the trade usually pays.
- Public and browser-facing APIs are where it usually does not.