Machine to machine

Google readies next-gen RPC protocol to replace JSON

Pro
Image: Stockfresh

24 August 2016

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 micro-services.

Originally unveiled early 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 of these 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 is faster still to serialise and de-serialise 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 (e.g., Python 3). Previously, if you wanted to use gRPC, you had to put together a number of the pieces yourself. To get set up with 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 things. gRPC addresses both of these problems while also providing lower latencies and smaller memory footprints, he said.

The one drawback to HTTP/2 and gRPC/protocol buffers, according to Philips, is that since they’re both binary, compressed formats, they aren’t directly human-readable. For people who are used to JSON as a standard data interchange format for micro-services, this will seem like a step backwards, 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.

 

 

IDG News Service

Read More:


Back to Top ↑

TechCentral.ie