gRPC - TL;DR

gRPC - Information for absolute beginners

Contents
Share on:  
                 

gRPC TL;DR



gRPC

  • gRPC system initially developed at Google in 2015 for internal use. It is open-sourced in 2016.
  • gRPC is an open-source remote procedure call (RPC) framework.
  • gRPC is used for a server to server or client to server communication.
  • gRPC is preferred when you need low latency, highly scalable and distributed system.
  • Most common use case of gRPC is to communication between microservices.
  • It can also use in mobile and desktop application to communicate with Server. It is a good alternative to GraphQL and REST API if an application required speed and performance.
  • gRPC officially supports C, C++, C#, Go, Dart, Java, Kotlin, Node.js, Objective-C, PHP, Python and Ruby.
  • gRPC Web is a JavaScript implementation of gRPC for a web application. gRPC-Web require a special proxy, by default it uses Envoy proxy.
  • Protobuf is default and the first implementation of data format or content type.
  • gRPC is used by Square, Netflix, CoreOS, Docker, CockroachDB, Cisco, Juniper Networks and many organizations.
  • gRPC use Interface Definition Language (IDL) for both service interface and structure or payload.
  • gRPC supports unary, server streaming, client streaming, bidirectional streaming.
  • Unary RPC is like REST API request and response.
  • Server streaming where the client request to the server once and the server sends multiple data back to the client.
  • Client streaming where the client sends multiple data to the server.
  • Bidirectional streaming where the client and server both send multiple data to each other.
  • gRPC also supports synchronous and asynchronous calls.
  • gRPC has metadata which is similar to HTTP headers, Metadata is key-value pairs where key and value are always string type. It can also use for authentication.
  • gRPC provides simple authentication API which allows a developer to provide necessary auth information as Credentials.
  • It supports SSL/TLS, ALTS and Token-based authentication.
  • gRPC has standard and rich error models. The standard model includes error code and message. Error information is available to gRPc clients in all supported languages. The rich error model is available if you’re using protocol buffers as data format.
  • gRPC+Protobuf is 7 to 10 times faster compared to REST+JSON https://medium.com/@EmperorRXF/evaluating-performance-of-rest-vs-grpc-1b8bdf0b22da