From REST to gRPC: An API Evolution Story
May 2017 • Presentation
In this talk, we describe how we moved backing Watson Discovery microservices from REST to gRPC and the lessons we learned in the process.
Software Engineering Institute
An existing REST-based microservice, a new requirement to use gRPC, a team under pressure to ship… In this talk, we describe how we moved backing Watson Discovery microservices from REST to gRPC and the lessons we learned in the process.
The APIs for components in fine-grained service-oriented architectures strongly influence the eventual properties expressed in the system. REST over HTTP is a popular choice for microservices APIs because it promotes openness, self-discovery, and simplicity. One alternative to REST is gRPC, an implementation of Protobuf. As an RPC-based API, gRPC inhibits openness and self-discovery but promotes performance and, depending on the implementation, can provide stronger compile-time (or at least call-time) guarantees, which help developers avoid mistakes. By the end of this talk, attendees will know
- what gRPC is and how it is different from REST
- how to organize code to make API transitions easier
- the benefits of functional testing using Cucumber and tips for creating extensible gRPC API tests using Ruby
- how to implement common REST patterns in gRPC
- common pitfalls for using gRPC in a microservices architecture and some solutions