Google readies next-gen RPC protocol to replace JSON

Google readies next-gen RPC protocol to oust JSON
Credit: Shutterstock

Google's gRPC aims to oust JSON for exchanging data between HTTP-connected services

With the 1.0 release of its gRPC protocol, Google aims to provide a next-generation standard for server-to-server communications in an age of cloud microservices.

Originally unveiled last year, gRPC was conceived as a transport framework for handling both public- and private-facing service endpoints. It uses HTTP/2 for its network features -- flow control, header compression, multiplexing requests for speed -- and employs another Google invention, called protocol buffers, to transmit the actual RPC data.

Both features are meant to improve the traditional method of having web services talk to each other by sending JSON-encoded data over HTTP. Connections between servers with HTTP/2 are supposed to be faster and more efficient, and Google claims it's faster still to serialize and deserialize the data with protocol buffers than with JSON. (Google provides gRPC and protocol buffer platform libraries for most major languages.)

The 1.0 release touts ease of use, API stability, and breadth of support (such as Python 3). Previously, if you wanted to use gRPC, you had to put together a number of the pieces yourself. To set up the current release, developers do little more than install the needed library from a given language's package manager.

Even before gRPC was fully baked, third parties began taking an interest in it for their projects. Docker adopted gRPC as the messaging protocol for nodes in Docker 1.12. CoreOS, maker of the container-oriented Linux system, picked up on gRPC and made it into the standard messaging component for the third release of its ETCD distributed key-value store, which is used to maintain consistency of state across clusters.

Brandon Philips, CTO of CoreOS, described in a phone call why gRPC was an attractive alternative to JSON over HTTP. "JSON is kind of the default language of the Internet these days, and so most APIs are JSON-encoded," he said. But Philips also noted that JSON and HTTP make it difficult to efficiently request multiple items. gRPC addresses both problems while also providing lower latencies and smaller memory footprints, he said.

According to Philips, there's one drawback to HTTP/2 and gRPC/protocol buffers: Since they're both binary, compressed formats, they aren't directly human-readable. For those used to JSON as a standard data interchange format for microservices, this will seem like a step backward since additional tooling is needed to inspect and parse gRPC traffic.

But Google is hoping the momentum behind HTTP/2 -- as seen in products like Nginx -- and third-party interest in gRPC will allow others to see it as a viable solution.

From CIO: 8 Free Online Courses to Grow Your Tech Skills
View Comments
Join the discussion
Be the first to comment on this article. Our Commenting Policies