SteelReed

Search

Search posts, questions…

Web & REST APIQuestion 18 / 25

Middle

How does gRPC work, which call types does it have, and when should you use it?

Short answer

gRPC lets the caller invoke a method on a stub like a local call; the framework serializes with Protobuf and sends it over HTTP/2. The contract is a .proto file that generates client and server code for many languages.

generate codegenerate codeProtobuf over HTTP/2Protobuf reply.proto contractclient stubserver servicecalling code

3 points to say:

  1. .proto is the contract that generates code for many languages; small binary payloads, strict types.
  2. 4 call types: unary, server streaming, client streaming, bidirectional.
  3. Fits internal service-to-service calls; for browsers and public APIs REST is easier. Always set a deadline; it needs an L7 LB.

Keep reading the deep dive

Create a free account to read the full explanation and follow-up questions, mark questions as studied and review them on a schedule.