# What gRPC Is — gRPC

Source: https://www.skillbyai.com/en/grpc/f-what

> Remote procedure calls with a contract.

## Contract first, code generated

**gRPC** is an open-source remote procedure call framework, originally developed at Google and now a CNCF project. You define services and messages in a **.proto** file; tools generate a **client stub** and a **server interface** in many languages (Go, Java, C++, Python, C#, Node.js, Kotlin, Swift, Rust and others). The client calls a method such as `GetOrder(request)` and the framework serialises the request, sends it, and returns a typed response, so polyglot services share one contract.

## Calling remote functions efficiently

gRPC lets services call each other's methods as if they were local, using a typed contract and an efficient transport.

![Three ideas: what gRPC is, HTTP/2 and Protocol Buffers, when to use it.](assets/figures/grpc/section-1-map.svg) — Figure 1.1 — RPC, transport and fit.

## A phone extension directory

Instead of writing a letter in any format (a free-form HTTP request), you dial a known extension and follow an agreed script; both sides know exactly what will be said.

## Treat .proto files as the API

Review, version and publish proto files like any public interface; generated code follows from them.

**Quiz:** What does a gRPC client call?

- [ ] SQL stored procedures
- [ ] Arbitrary URLs with free-form JSON
- [x] Generated stub methods defined in the .proto service
- [ ] Shell commands on the server

*Answer:* Generated stub methods defined in the .proto service. Typed methods from the contract.
