Building Microservice APIs Using GRPC
Microservices architecture frameworks have been developed by the community of software engineers to solve some of the problems supporting the client-server model. G Remote Procedure Calls (GRPC) is a microservice framework which uses the new HyperText Transfer Protocol version 2 (HTTP2) to support many different clients such as desktops, browsers, mobile devices, etc., and handle communications between them and the servers in an efficient manner. GRPC gives opportunity to use protobuffers which offer maintainability and scalability features by defining services and messages. The protofiles can then be transpiled from the proto language to the specific programming language implementation of the applications. One of the benefits gained in using protobuffers is the client applications are able to find errors within its source code in compile instead of runtime, raising its stability factor. In addition, GRPC offers many different channels of communication between the server and clients, such as Simple RPC, Server-side Streaming RPC, Client-Side Streaming RPC, and Bidirectional RPC, and each have their purpose to solve specific use cases. We demonstrate each channel in a fictitious forum application to help explain their functionality. GRPC also offers error handling between the channels to ensure clients can follow a standard. In addition, GRPC also offer the capability to pass authentication information between client and server within the message. We look at GRPC as a microservice framework to help support the multitude of client applications written in many different programming languages and still maintain a stable line of communication with the server.