Who is this book for?
This book is for engineers writing applications with different components that need to talk to each other. If you are a backend developer that wants a solution with better performance than JSON and REST for connecting microservices, this book is for you. If you are looking for strong contracts and streaming when building APIs and services, this book is for you.
This book explains gRPC, at multiple layers and with precise examples, to empower engineers to build these types of systems. It’s for engineers that want to know the entire gradient, from the simplest form of issuing an RPC to more advanced functionality and even how the RPC itself is structured on the wire.
What do you need to know prior to reading?
This book is intended for software engineers, so having some level of experience will be very valuable in getting the most from this book.
The book includes code samples in several languages. Most of the examples are simple enough that you don’t need to be an expert in any particular language to follow along. In fact, you may not be familiar with the given language at all, but should still be able to follow the logic and intent. Having said that, Go and Ruby developers will likely find themselves most comfortable reading the code because most of the examples are in those two languages.
This book does not attempt to introduce or define things like “service-oriented architectures” and “micro-services,” so an intermediate level of experience with these kinds of distributed systems will be valuable. It does provide an overview and brief history of communication protocols, but some familiarity with standards like HTTP/REST and JSON will be really helpful to get the most out of it.
Online examples
All of the code for the example application, as well as many of the code examples throughout the book, can be found in GitHub: https://github.com/backstopmedia/gRPC-book-example
What will this book provide?
This book will introduce you to gRPC and explain how it compares and contrasts with similar technologies. It will introduce you to Protocol Buffers, a key technology for using gRPC. It then provides information on how to make use of gRPC, from the most basic of usage, all the way to advanced capabilities. And it also provides lots of information for making the most of gRPC: from best practices for defining and evolving your gRPC APIs to tools in the ecosystem and how they can be leveraged to get the most out of gRPC and even extend it.
By the end of this book, you should have a clear understanding of the following:
- What gRPC is and what its role is in applications.
- How to use Protocol Buffers and gRPC to connect systems.
- The mechanics of gRPC, including the underlying HTTP/2 protocol as well as how data is serialized and de-serialized.
- Tools and practices to aid with successfully implementing gRPC in your applications.
Author Bios
Carles Sistare (carlessistare
on GitHub, CarlesSistare
on Twitter) is a challenge trotter eager of projects who offer the opportunity to learn about the most recent technologies. Keeping a close eye on the open source community, three years ago, he began to be interested in gRPC, and quickly saw the benefits when it comes to microservice communication optimisations. Since then he has been doing several talks in France in order to evangelise gRPC and made grpc-promise
. Carles had the opportunity to co-found OGURY, ad-tech company based in Paris, where currently works as Head Architect.
David Konsumer (konsumer
on GitHub, davidkonsumer
on Twitter) has been working with open-source for about 20 years, with a strong focus on JavaScript. Before working with Node.js, he used PHP and Python to accomplish his daily programming tasks. He worked at NodeSource, to make N|Solid, Plex, Janrain, and Intel on the App Developer Program website. He also did lots of agency, freelance, and contract-work, mostly for the web and cloud-based backend work. He taught programming classes at Free Geek, Portland. David is an advocate for accessible programming and the idea that everyone can learn to code, and it should be easy enough to get cool stuff done. He made grpcnode
, node-protoc-plugin
, and json2x
, useful tools for getting things done with gRPC/protobuf in Node.js. David currently works as Lead of Engineering at Gummicube, an App-store Optimzation company based in San Jose, running the development department in Portland, OR.
David Muto (pseudomuto
on GitHub, pseudomuto
on Twitter) has been writing software professionally for over 15 years, and is a strong believer in continuous learning. Over the years he has written production quality code in over a dozen languages, taught application development at George Brown College (in Toronto) and worked on everything from web and mobile apps, to low-level systems and RPC services. He’s a serial OSS contributor and the author of protoc-gen-doc, a tool for generating documentation from Protocol Buffers. He also recently published protokit, a library for building your own protoc
plugins in Go. David currently works at Shopify leading a team that develops highly available, low-latency, distributed services in the Data Science and Engineering department.
Joshua Humphries (jhump
on GitHub) has been working with Protocol Buffers and building RPC systems and related facilities for over six years. He was first introduced to Protocol Buffers and “Stubby” (gRPC’s forebearer) while working at Google. Afterwards, he led a team that worked on protobuf-based RPC at Square, including “smart clients” in Java, Go, and Ruby that handled service discovery, load balancing, automatic retries, and automatic geographic failover. Joshua has been an advocate of gRPC since its initial release. He continues his work with Protocol Buffers and gRPC as part of an infrastructure team at FullStory, a customer experience management platform. He is a contributor to the Go open-source projects for gRPC and Protocol Buffers, the author of a Go library for Protocol Buffer reflection named protoreflect
, and the author of gRPC-related projects open-sourced by FullStory, including grpcurl
.
Robert Ross, but people call him Bobby Tables (bobbytables
on GitHub, bobbytables
on Twitter) is a full time staff
software engineer at Namely where he works on the architecture team. He writes with Go and Ruby primarily, but can swing
some JavaScript if needed. He operates FireHydrant on the side while listening to the Hamilton soundtrack an unhealthy amount.
Technical Reviewers
Special thanks goes to our technical reviewers who helped make this a better book: Bojan Djurkovic, David Gasquez, and Jeff Willette.