Skip to content
BENIBIX Learn

REST API vs gRPC

People think gRPC is just a faster REST, and it is not. REST gives each thing an address and uses HTTP methods on it, with JSON most people can read. gRPC calls named functions and sends packed bytes. It is faster between services, but a browser cannot call it without help.

Development🔌 APIs

REST API

A web API where each thing has its own address, and HTTP methods act on it.

A REST API gives each thing, called a resource, its own web address. You act on them with the normal HTTP methods: GET to read, POST to create, PUT or PATCH to change and DELETE to remove. Each request carries everything the server needs, so the server keeps no memory between requests. Answers are usually JSON. REST was described by Roy Fielding in 2000 and is the most common style of web API.

Example
Jack's REST API has /books and /books/7. GET /books/7 reads book 7, and DELETE /books/7 removes it.
Why it matters
Most public web APIs follow REST. Learn it once and you can use thousands of them.
Full entry
Development🔌 APIs

gRPC

A fast way for one service to call another. Its messages are small.

gRPC is a fast way for services to call each other's functions. Google made it and opened it to everyone in 2015. You describe each service and its messages in a .proto file. Tools turn that file into ready code for many languages. Messages are sent in a small binary format called Protocol Buffers, over HTTP/2. It is fast and strict, so firms use it between their own services.

Example
Jack's 12 back-end services talk to each other with gRPC. One .proto file keeps every service's Go and Python code in step.
Why it matters
Its messages are smaller and faster than JSON. The shared file also catches wrong fields before the code runs.
Full entry

In one line

REST API
A web API where each thing has its own address, and HTTP methods act on it.
gRPC
A fast way for one service to call another. Its messages are small.