Skip to content
IT glossary
BackendUpdated December 3, 2026

gRPC

A framework that lets one application call a method on another application over a network. The two applications typically share a contract that defines which methods are available and what data they exchange.

A method call across a network

Suppose an order service needs a product name from a catalog service. With gRPC, it can call a method named GetProduct through a client library rather than build an HTTP request by hand. That looks like a local method call in application code, but the catalog runs elsewhere. The call can time out, and a missing response doesn't tell you whether the server performed the operation.

From contract to call

A gRPC API is usually defined in a .proto file. It lists service methods and uses Protocol Buffers (Protobuf) to define the structure of their requests and responses. A generator produces message types and the client stub, along with server-side code that connects incoming calls to handlers you implement. The same contract can generate bindings for different languages, such as Go on the server and Java on the client.

Native gRPC runs over HTTP/2 and uses binary Protobuf messages by default. HTTP/2 lets multiple calls share a connection without waiting for each other to finish. A unary call has one request and one response. In a streaming call, the client, the server, or both can send a sequence of messages over a single call. The call ends with a gRPC status such as OK or NOT_FOUND, which is distinct from the HTTP status.

Example: Look up a product

syntax = "proto3";

service Catalog {
  rpc GetProduct (ProductRequest) returns (Product);
}

message ProductRequest {
  string id = 1;
}

message Product {
  string name = 1;
}

This is a unary RPC: the client sends a product ID, and the server returns one message with the product name if it finds a match. The numbers identify fields in the binary encoding; they're not default values. If you remove a field, reserve its number so a future version can't accidentally give it a different meaning.

When to choose gRPC

gRPC fits internal service APIs where teams want generated clients from a shared contract or need streaming as part of the API. For a browser-facing public API, REST with JSON is often easier for consumers to call and inspect. Browsers commonly use gRPC-Web with a compatible endpoint or proxy rather than calling a native gRPC endpoint directly.

What interviewers look for

Expect to explain what happens when a dependency is slow. Set a deadline to limit how long the caller waits, and decide which operations are safe to retry. Retrying a product lookup is usually fine; retrying order creation can create a duplicate if the first call succeeded but its response didn't arrive in time. An idempotency key lets the server recognize a retry as the same logical request.