Skip to content

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).

  • Internal microservice-to-microservice communication
  • Low-latency APIs with strongly typed contracts
  • Google: created gRPC and uses it extensively internally
  • Uber: widely uses gRPC for internal services

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
syntax = "proto3";
service Users {
rpc GetUser (GetUserRequest) returns (User);
}
message GetUserRequest {
int32 id = 1;
}
message User {
int32 id = 1;
string name = 2;
}
Built with passion by Ngineer Lab