Skip to Content
Learning API Styles
book

Learning API Styles

by Lukasz Dynowski, Marcin Dulak
July 2025
Intermediate to advanced
414 pages
10h 22m
English
O'Reilly Media, Inc.
Book available
Content preview from Learning API Styles

Chapter 8. gRPC

RPC stands for Remote Procedure Call. As the name suggests, the RPC API style focuses on interaction with APIs by invoking remote procedures (functions). RPC APIs are characterized by intent-oriented interfaces, where an intent describes specific actions (operations), such as “CreateUser” or “GenerateReport.” This approach lies on the opposite side of the spectrum compared to REST. REST focuses on retrieval and modification of resources,1 like “User” and “Report,” using standardized HTTP methods like GET, POST, PUT, and DELETE.

gRPC2 may currently be the most widely adopted RPC implementation.3 It describes itself as a “high performance, open source universal RPC framework.” The project was created by Google, and in 2017, it was donated to the Cloud Native Computing Foundation, which hosts it at https://grpc.io.

After describing the overall goals of RPCs, this chapter introduces you to gRPC and its features. You’ll explore Protocol Buffers (the binary serialization format) and the HTTP/2 protocol (the transport mechanism used by gRPC; see “HTTP/2”). Using an implementation of an ECHO service, you’ll become familiar with the four RPC types supported by gRPC: unary, server streaming, client streaming, and bidirectional streaming. Next, using gRPC, you’ll enrich the WFS’s web feed from Chapter 7, with the content generated by a locally running LLM. The chapter ends with a discussion of gRPC security aspects, documentation, and trade-offs.

Remote Procedure Call

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

API Design Patterns

API Design Patterns

John J. Geewax
Designing APIs with Swagger and OpenAPI

Designing APIs with Swagger and OpenAPI

Lukas Rosenstock, Joshua Ponelat
Learning TypeScript

Learning TypeScript

Josh Goldberg

Publisher Resources

ISBN: 9781098153984Errata Page