In this post I’ll briefly describe the problem in the gRPC domain and a solution based on gRPC-Web, Envoy proxy and Istio to neatly solve it.
What is gRPC?
gRPC is a universal, high-performance, open-source RPC framework based on HTTP/2. Essentially, it lets you easily define a service using Protocol Buffers (Protobufs), works across multiple languages and platforms, and is simple to set up and scale. All this leads to better network performance and flexible API management.
Benefits of gRPC-Web
gRPC-Web addresses a shortcoming in the core gRPC framework. As developers look to benefit from the advantages it confers beyond backend microservices—the fact that it doesn’t work so well with web applications running on browsers. Although most browsers support HTTP/2 and gRPC is based on HTTP/2, gRPC has its own protocols that web applications must understand in order to work properly with it. Web applications do not have this capability because browsers don’t support gRPC out of the box.
One way to get around this problem is to use the gRPC-Web plugin and run a proxy like Envoy along with it. Envoy serves as the default proxy for Istio, and on configuring its gRPC-Web filter, it can transcode HTTP requests/responses into gRPC requests/responses for you.
Service Mesh Day
The first ever Service Mesh conference named Service Mesh Day was hosted by Tetrate, with support from Google and CNCF, on 29th March 2019 in San Francisco. The conference attracted over 200 attendees ranging from investors, customers, engineers, and leaders.
At the conference I spoke about the relevance of Service Mesh technologies, particularly Istio and Envoy, for gRPC workloads in my talk Seamless Cloud-Native Apps with gRPC-Web and Istio.
In my talk, I showed a demo of a web app that uses gRPC-Web on the front end, and a simple Go backend exposing a gRPC API. I deployed the application on Istio, which configured the Envoy proxy and the gRPC-Web filter automagically. The front and backend talked seamlessly, while Istio provided additional observability into the system via Grafana metrics, Jaeger tracing and the Kiali service graph.
The bottom line here is that by switching over to a gRPC-Web and Istio paradigm, developing a cloud-native application becomes a relatively seamless experience.