gRPC and Protocol Buffers

In gRPCClosedOpen source remote procedure call (RPC) framework that can run anywhere. It enables client and server applications to communicate transparently, and makes it easier to build connected systems. gRPC uses protocol buffers, Google's mature open source mechanism for serializing structured data — think XML, but smaller, faster, and simpler., a clientClosedA desktop computer, laptop, smartphone or tablet, as well as any other electronic device that sends or receives data from a server. The term implies a connection to a wired or wireless network. application can directly call a method on a serverClosedA computer that provides data to other computers. Many types of servers exist, including web servers, mail servers, and file servers. Each type runs software specific to the purpose of the server. For example, a Web server may run Apache HTTP Server or Microsoft IIS, which both provide access to websites over the Internet. A mail server may run a program like Exim or iMail, which provides SMTP services for sending and receiving email. A file server might use Samba or the operating system's built-in file sharing services to share files over a network. application on a different machine as if it were a local object, making it easier to create distributed applications and services. As in many RPC systems, gRPC is based around the idea of defining a service, specifying the methods that can be called remotely with their parameters and return types. On the server side (Token CloudClosedFunctionality, data and resources running on physical and virtual servers maintained and controlled by Token, and accessed via an Internet connection.), the server implements this interface and runs a gRPC server to handle client calls. On the client side, the client has a stub that provides the same methods as the server.

Here's the best way to think about it (hover to enlarge):

gRPC clients and servers can run and talk to each from different environments. For instance, a gRPC server in JavaClosedProgramming language and computing platform first released by Sun Microsystems in 1995. There are lots of applications and websites that will not work unless you have Java installed, and more are created every day. Java is fast, secure, and reliable. From laptops to datacenters, game consoles to scientific supercomputers, cell phones to the Internet, Java is everywhere! can support clients in JavaScriptClosedOften abbreviated as JS, JavaScript is an interpreted programming language that conforms to the ECMAScript specification — high-level, often just-in-time compiled, and multi-paradigm. It has curly-bracket syntax, dynamic typing, prototype-based object-orientation, and first-class functions. Alongside HTML and CSS, JavaScript is one of the core technologies of the World Wide Web. All major web browsers have a dedicated JavaScript engine to execute it., C#ClosedGeneral-purpose, multi-paradigm programming language encompassing strong typing, lexically scoped, imperative, declarative, functional, generic, object-oriented (class-based), and component-oriented programming disciplines. It was developed around 2000 by Microsoft as part of its .NET initiative, and later approved as an international standard by Ecma (ECMA-334) and ISO (ISO/IEC 23270:2018)., or Java.

Using protocol buffersClosedSpecifies how serialized information is structured by defining message types in .proto files. Each protocol buffer message is a small logical record of information containing a series of name-value pairs. Protocol buffers have many advantages over XML for serializing structured data, including being simpler, 3 to 10 times smaller yet 20 to 100 times faster, all whilst being less ambiguous, in addition to generating data access classes that are easier to use programmatically. (or protobuffs, for short), serialized information is structured by defining protocol buffer message types in .proto files. Each protocol buffer message is a small logical record of information, containing a series of name-value pairs. A fairly simple example of a .proto file that defines a message containing information about a Token business member might look like this:

message Signature {

   string member_id = 1;

   string key_id = 2;

   string signature = 3;


The protocol buffer compiler then generates data access classes. These provide simple accessors for each field — like member_id() and set_member_id() — as well as methods to serialize/parse the whole structure to/from raw bytes. Hence, building a Signature in JavaScript is as easy as:

Signature {

   memberId = 'member_id string',

   keyId = 'key_id string',

   signature = 'signature string'


In JavaScript, the object corresponding to a protocol buffer message has fields with camel-case names. Protocol buffer field member_id in Signature therefore becomes the JavaScript field memberId, key_id becomes keyId, and so forth.Thus, a protocol buffer string becomes a JavaScript string; a protocol buffer number becomes a JavaScript number. A protocol buffer enum value becomes a JavaScript string. For example, if a .proto enum has a value of ENDORSED = 1, then in JavaScript, this value is 'ENDORSED'. A repeated protocol buffer field becomes a JavaScript array. Protocol buffer bytes become a JavaScript string representing the Base64 encoding of those bytes.

For more on protocol buffers and gRPC from, click the respective link.