Lesson 24Working with gRPC

In the last decade, REST APIs have become the standard option for applications and systems to communicate with each other. However, in 2015, Google introduced the concept of a modern open source remote procedure call, gRPC, which provides the same functionality of REST APIs with faster, lighter, and more flexible services and communications. As a result, Google Remote Procedure Call, or gRPC, is now supported by most programming languages. In this lesson, you'll learn about gRPC in the context of Go.

WORKING WITH gRPC

In the simplest terms, gRPC is a modern, open source remote procedure call (RPC) framework that can run anywhere. An RPC is a function within an application that can be executed remotely by another application. RPCs are particularly common in distributed systems where one computer wants to invoke methods or functions hosted on another machine in the distributed system.

gRPC is similar to a REST API in that you are exposing services hosted on a server to clients. There are a few differences between gRPC and REST:

  • gRPC uses HTTP/2 whereas REST uses HTTP 1.1. This allows gRPC to leverage capabilities of HTTP/2 such as server-side and client-side streaming.
  • gRPC uses the Protocol Buffers (Protobuf) data format whereas REST uses JSON.
  • In a traditional ...

Get Job Ready Go now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.