Google Cloud published a blog post on how to expose gRPC services to the rest of the world using RESTful APIs.
gRPC is a popular choice for internal or so-called "east-west" service-to-service communications. While gRPC exhibits superior performance characteristics, a significant number of APIs currently utilize HTTP as their primary communication protocol. Migrating these APIs to gRPC would require a substantial investment of resources, particularly considering that not all developers are familiar with the gRPC framework.
To overcome this challenge, we want to provide an adapter layer that provides a more traditional JSON HTTP-based API for the service. Instead of manually writing the protocol translation ourselves, we decided to use the open-source gRPC gateway project to automatically generate an adapter for our use case.
Leveraging Apigee as the enterprise API management platform helps us expose a clean RESTful API facade in a secure and self-service manner.
In conclusion, Google Cloud demonstrated how gRPC services can be easily exposed to new audiences as HTTP APIs, while also leveraging the benefits of a comprehensive API management platform like Apigee. By combining the performance of gRPC with the familiarity and tooling of REST APIs, we can unlock new possibilities for our services and data, reaching a wider range of developers and applications.