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.
// RELATED_COMPARISONS
REST vs gRPC: A Detailed Comparison for System Design
Compare REST and gRPC for system design — explore trade-offs in performance, serialization, streaming, and language support for microservices.
REST vs GraphQL: A Detailed Comparison for System Design
Compare REST and GraphQL APIs — learn the trade-offs in flexibility, performance, caching, and developer experience for modern system design.
GraphQL vs gRPC: A Detailed Comparison for System Design
Compare GraphQL and gRPC — explore trade-offs in flexibility, performance, schema design, and when to use each in modern distributed systems.
REST vs WebSocket: A Detailed Comparison for System Design
Compare REST and WebSocket protocols — understand when to use request-response vs persistent bidirectional connections in system design.
SOAP vs REST: A Detailed Comparison for System Design
Compare SOAP and REST APIs — learn the differences in protocol design, data formats, security, and when each approach fits your architecture.
tRPC vs REST: A Detailed Comparison for System Design
Compare tRPC and REST for full-stack TypeScript apps — explore trade-offs in type safety, performance, developer experience, and flexibility.