SDI.
All Protocols
Request-Response

gRPC

gRPC is a high-performance RPC framework using HTTP/2 and Protocol Buffers for strongly-typed, low-latency communication between services with support for bidirectional streaming.

gRPC lets services call each other's methods as if they were local function calls. You define your API in a `.proto` file specifying messages and services, then code generation produces client and server stubs in your chosen language. It uses Protocol Buffers (binary serialization, 3-10x smaller than JSON) over HTTP/2 (multiplexing, header compression). It supports four communication patterns: unary, server streaming, client streaming, and bidirectional streaming. It's the go-to for internal microservice communication at companies like Google, Netflix, and Square.

Strengths

  • 3-10x smaller payloads and 20-100x faster serialization compared to JSON via Protocol Buffers
  • Bidirectional streaming over persistent HTTP/2 connections with flow control
  • Strongly-typed contracts with compile-time validation via code generation from .proto files
  • Built-in deadline propagation prevents cascade failures across service call chains
  • First-class support in service meshes (Istio, Linkerd) and cloud-native infrastructure
  • Polyglot code generation supports 10+ languages from a single .proto definition

Weaknesses

  • No native browser support — requires gRPC-Web proxy layer for web clients
  • Binary payloads are not human-readable, making debugging harder without specialized tools
  • Requires L7 load balancing (Envoy, Linkerd) since persistent connections bypass L4 load balancers
  • Steeper learning curve: protobuf schema design, code generation pipelines, and streaming semantics
  • Smaller ecosystem of API gateways, documentation tools, and developer utilities compared to REST
  • Proto file management and code generation adds build complexity, especially across multiple repositories

Technical Profile

Latency Profile

gRPC unary calls typically achieve 1-10ms latency for in-datacenter communication due to binary serialization and HTTP/2 connection reuse. Cross-region latency is dominated by network RTT. Streaming RPCs eliminate per-message connection overhead entirely. Compared to REST+JSON, p99 latency is typically 30-50% lower under equivalent load.

Payload Format

Protocol Buffers

Browser Support

No

Streaming Support

Bidirectional

Schema Enforcement

Required

Ideal Use Cases

  • Low-latency, high-throughput microservice-to-microservice communication
  • Real-time streaming applications (live data feeds, log streaming, chat)
  • Polyglot environments where multiple languages need to communicate with type safety
  • Mobile clients on constrained networks where payload size and bandwidth matter
  • Service mesh architectures with Kubernetes, Envoy, and Istio

Real-World Examples

Google

gRPC is the successor to Google's internal Stubby framework, used for virtually all internal service communication handling billions of RPCs per second

Netflix

Uses gRPC for inter-service communication in their microservice architecture, replacing their previous REST-based protocol for performance-critical paths

Square

Adopted gRPC across their payment processing infrastructure for type-safe, low-latency communication between services handling financial transactions

Dropbox

Migrated from a custom RPC framework to gRPC for internal service communication, citing improved performance and better multi-language support

Slack

Uses gRPC for backend service communication to handle real-time messaging at scale with efficient binary serialization

Likely Follow-Up Questions

  • How would you handle gRPC load balancing in a Kubernetes environment, and why can't you use a standard L4 load balancer?
  • Explain how deadline propagation works across a chain of gRPC services and why it prevents cascade failures.
  • How would you evolve a protobuf schema without breaking existing clients? What are the rules for backward compatibility?
  • Compare gRPC streaming with WebSocket for a real-time chat application — what are the trade-offs?
  • How would you expose a gRPC service to browser clients? Describe the gRPC-Web architecture.

Source: editorial — Synthesized from gRPC official documentation, CNCF case studies, and production experience patterns from Google, Netflix, and Square engineering blogs.

Command Palette

Search for a command to run...