American Express: Go-ing With gRPC

By Benjamin Cane

Elevator Pitch

At American Express, gRPC services written in Go play an essential role. In this session, you’ll learn the basics of building production-ready gRPC services in Go and hear real-world lessons learned. You’ll also pick up best practices around project structure, maintaining .proto files and more.

Description

gRPC is a fast-growing communications protocol for backend services. Within American Express, gRPC services written in Go play an important role in the company’s payment network. Hear about American Express’ journey writing gRPC services in Go.

The central part of the talk will focus on how to build a basic gRPC service. Participants will also learn about the project structure American Express used for Go services, a common pain point for engineers learning to write in Go.

We will share insightful .proto file management practices learned from real-world applications at American Express. These practices make it easier to use gRPC for communication across enterprise platforms.

Attendees will walk away from this talk with an enhanced understanding of gRPC and Go.

Notes

By the time of this event in June 2020, American Express will have been working with gRPC and Go for two years. We started writing our first production services in Go in early 2018. We adopted gRPC as the backend protocol for those services in August of that year.

American Express choose gRPC in much the same way we chose Go (https://go.dev/solutions/americanexpress). After experimenting with other protocols, we ultimately landed on gRPC because it gave us both performance and simplicity in development.

As we moved forward with gRPC we achieved many successes, but also hit some roadblocks along the way. These roadblocks required us to dig deeper into gRPC and, in some cases, go beyond simple sync calls. We’ve had to expand into topics like setting custom headers, bi-directional streams, and returning custom errors.

My goal for this talk is to show a simple gRPC service. But then expand into the lessons we learned along the way to make writing gRPC services in Go easier.