TECH_COMPARISON
gRPC vs REST Protocol: A Detailed Comparison for System Design
Compare gRPC and REST at the protocol level — explore differences in HTTP/2, serialization, streaming, and service definition approaches.
gRPC vs REST Protocol
This comparison focuses on the protocol-level differences between gRPC and REST. While the broader REST vs gRPC comparison covers architectural trade-offs, this entry dives into transport, serialization, and wire-level details.
HTTP/2 Advantages
gRPC mandates HTTP/2, which provides multiplexing (many requests over one connection), header compression (HPACK), and binary framing. REST typically runs over HTTP/1.1, where each request blocks the connection until the response arrives.
Multiplexing is especially valuable for microservices that make many parallel calls — a single TCP connection handles all of them without head-of-line blocking.
Protocol Buffers vs JSON
Protobuf uses field numbers instead of field names, binary encoding instead of text, and varints for integers. A message that is 200 bytes in JSON might be 40 bytes in Protobuf. At millions of messages per second, this 5x reduction in payload size translates directly to bandwidth and CPU savings.
Deadline Propagation
A unique gRPC feature: deadlines automatically propagate through call chains. If Service A calls Service B with a 5-second deadline and 2 seconds elapse, Service B knows it has 3 seconds remaining. REST has no standard mechanism for this.
Learn more about protocol design in our concepts library and system design interview guide. See pricing for practice.
The Bottom Line
gRPC's protocol-level advantages — HTTP/2 multiplexing, binary serialization, streaming, and deadline propagation — make it superior for internal service communication. REST's universal accessibility makes it the right choice for external APIs.
GO DEEPER
Master this topic in our 12-week cohort
Our Advanced System Design cohort covers this and 11 other deep-dive topics with live sessions, assignments, and expert feedback.