gRPC
This content is for Backend. Switch to the latest version for up-to-date documentation.
gRPC is a high-performance RPC framework that commonly uses HTTP/2 + Protocol Buffers.
It’s most often used for service-to-service communication inside a company (microservices).
Where gRPC Is Used
Section titled “Where gRPC Is Used”- Internal microservice-to-microservice communication
- Low-latency APIs with strongly typed contracts
Industry Examples (Companies)
Section titled “Industry Examples (Companies)”- Google: created gRPC and uses it extensively internally
- Uber: widely uses gRPC for internal services
Pros / Cons
Section titled “Pros / Cons”Pros:
- Fast (binary protocol + HTTP/2)
- Strong typing and code generation
- Supports streaming (client streaming, server streaming, bi-directional)
Cons:
- Browser support is more complex than plain REST
- Debugging by hand is harder than JSON APIs
Tiny Example (Proto)
Section titled “Tiny Example (Proto)”syntax = "proto3";
service Users { rpc GetUser (GetUserRequest) returns (User);}
message GetUserRequest { int32 id = 1;}
message User { int32 id = 1; string name = 2;}