Question #26 of 60•Microservices•Medium• ~3 min read

When should you choose gRPC / Protobuf over REST and GraphQL for microservices?

Executive Takeaway

Compare binary gRPC protocol serialization, HTTP/2 multiplexing, REST JSON convenience, and GraphQL flexible client schemas.

Architectural Breakdown & AnalysisFAANG Aligned

Microservice communication protocols directly impact CPU utilization, network bandwidth, and API schema governance.

ProtocolData FormatTransportSerialization OverheadPrimary Use Case
gRPCProtocol Buffers (Binary)HTTP/2 MultiplexedUltra-Low (5-10x faster than JSON)Internal Microservice-to-Microservice
RESTJSON / TextHTTP/1.1 or HTTP/2High (Verbose text strings)External Public Client APIs
GraphQLJSONHTTP/1.1HighMobile apps requiring flexible entity fields

Why gRPC Excels Internally

  • Strict Type Safety: Strongly-typed .proto schema files generate client/server code automatically.
  • HTTP/2 Multiplexing: Thousands of concurrent RPC calls share a single TCP connection stream.
TIP — Architecture Standard

Use REST or GraphQL at the edge API Gateway for browser compatibility. Use gRPC internally between backend microservices.

Previous QuestionHow do you design a Distributed Lock Manager (Redlock vs. ZooKeeper)?Next Question How do you design a High-Throughput Push Notification Service?

Continue Learning on Being SDE

Explore deep-dive system architecture modules, low-level object-oriented designs, and interview cheat sheets.